Jimmy Chang
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    前端文件 === ## 規則參考 ### 資料夾結構(D)&檔案(F)說明 * views(D) * 主畫面依照route規則命名資料夾,index.vue * components(D) * 依照畫面功能命名資料夾 * 先以垂直擴充為主,如有重複功能元件再以水平擴充 * lang(D) * i18n配著元件進行 * router(D) * 路由設定,url轉導、驗證定義 * style(D) * 共用style 以scss開發為主 * utils(D) * 可共用的 js function * .editorconfig(F) * 開發編輯規則 (IDE需下載擴充執行) 目前規則: 縮排統一兩格 * 開發coding style規則參照airbnbのeslint * *.vue * 以pug語法開發為主 ## 開發端相關 ### Vuex * 只允許在View內使用Vuex ### Router * 連結請使用<router-link></router-link> ```xml= <template> <div> <router-link :to="{ name: 'router-name' }"></router-link> </div> </template> ``` * router請記得取name ```javascript= [ { path: '/test/test', name: 'this-is-test-page', // 記得取名 component: () => import('@/views/test/test/index.vue'), hidden: true, }, ] ``` ### Loading 使用方法 ```javascript= /** * Loading example */ import WuwowLoadingMixin from '@/components/wuwowLoading/mixin/index.vue'; export default { mixins: [WuwowLoadingMixin], data() { return {}; }, async created() { // 取得標籤,啟動loading const tag = this.startLoading(); await new Promise((resolve, reject) => { setTimeout(() => { resolve('done 1'); }, 10 * 1000); }); // 關閉當前標籤程序,並關閉loading this.endLoading(tag); }, async mounted() { // 取得標籤,啟動loading const tag = this.startLoading(); await new Promise((resolve, reject) => { setTimeout(() => { resolve('done 1'); }, 5 * 1000); }) // 關閉當前標籤程序,並關閉loading this.endLoading(tag); } methods: { }, }; ``` ### 命名規則 #### Camel Case * Java script ```javascript= // thisIsATest資料夾 import '~/thisIsATest/index.vue'; // Upper camel case class ThisIsATest { } // Lower camel case let thisIsATest = 'this is a test.'; ``` #### Snake Case * Java script ```javascript= let i18n = { message: { tw: { // 內部的key this_is_a_test: 'this is a test', }, }, }; ``` * JSON ```json= { "message": { "tw": { "this_is_a_test": "this is a test" } } } ``` #### Kebab Case * pug ```pug= this-is-a-test-component inner-component ``` #### Const Case * Java script ```javascript= const THIS_IS_A_TEST = 'this is a test'; ``` #### 相關範例 * Java script ```javascript= // 開發coding style依照airbnb的eslint為主 // 請務必將每一行的分號寫出來 // 變數宣告都以CamelStyle做宣告 // 後端傳來的變數需要透過camelcase-keys套件切換過 // 要傳給後端的參數需透過 // 常數都以ConstStyle做宣告 import '~/thisIsATest/index.vue'; // 全域變數請用const以及全大寫以及下底線隔開來做命名 const GOOGLE_URL = 'https://google.com'; console.log(`The google url is: ${GOOGLE_URL}`); // 參考用的變數請用const宣告 const iAmEating = 'I am eating '; const apple = 'apple'; const banana = 'banana'; // 區域變數請都以小駝峰宣告,並且禁止使用var做宣告 let iAmEatintSomething = `${iAmEating}${apple}`; console.log(iAmEatSomething); // 請勿使用+來做字串相加,請使用``來做字串相加 iAmEatingSomething = `${iAmEating}${banana}`; console.log(iAnEatSomething); // 註解請參考 > https://jsdoc.app/ // @return > https://jsdoc.app/tags-returns.html // @param > https://jsdoc.app/tags-param.html /** * 檢查是否成年 * * @param {number} age 年紀 * * @returns {boolean} 是否成年 */ function adultOrNot(age = 0) { if (age > 18) { return true; } return false; } adultOrNot(10); // 陣列或者物件的最後一個元素後請加上逗號 // 一行即可宣告完畢的就可審略最後一個元素的逗號 const data = [ 1, 2, 3, 4, ]; // “建議”都使用箭頭函式,如有需要再使用function const isOdd = (num) => { return num % 2 === 0; }; const isEven = (num) => { return num % 2 !== 0; } const odd = data.filter(isOdd); const even = data.filter(isEven); ``` ### DNS |用途|開發端|測試機(工程師)|測試機(公司)|正式機| |-|-|-|-|-| |太極內|portal-dev.lst-taichi.wuwow.tw|it-lst-taichi.wuwow.tw||lst.wuwow.tw| |太極外(VUE)|portal-dev.lst-taichi-external-vue.wuwow.tw|it-lst-taichi-external-vue.wuwow.tw|company-lst-taichi.wuwow.tw|~~taichi.wuwow.tw~~ (暫時未上線)| |太極外|portal-dev.lst-taichi-external.wuwow.tw|it-lst-taichi-external.wuwow.tw||taichi.wuwow.tw| |API|portal-dev.taichi-api.wuwow.tw|it-taichi-api.wuwow.tw||api.wuwow.tw| |官網|portal-dev.wuwow-portal.wuwow.tw|it-wuwow-portal.wuwow.tw||www.wuwow.tw| |未知領域求大大填寫|portal-dev.media-source.wuwow.tw|it-media-source.wuwow.tw||未知領域求大大填寫| |Wuwow Junior||it-wuwow-junior-vue.wuwow.tw| ### 開發文件 * [太極外部權限](https://docs.google.com/spreadsheets/d/1-_GnluwuHm47zXdrt-WOX9sYyIzz68_fNPhxxMYB0mw/edit#gid=33769320) ### Http status code |狀態|原因|| |-|-|-| |500|後端try catch|Internal Server Error| |200|請求成功|OK| |202|此請求已經被接受但尚未處理|Accepted| |400|參數錯誤|Bad Request| |401|Token失效|Unauthorized| |403|不符權限|Forbidden| ### Docker * 開啟Docker ```shell= cd {自已的路徑}/211023_lioshutan/ docker-compose up -d php-worker laravel-echo-server nginx mysql phpmyadmin redis workspace php-fpm5.6 php-fpm7.0 php-fpm7.3 php-fpm8.0 php-fpm7.2 ``` * 關閉Docker ```shell= docker-compose down ``` * 進入Docker ```shell= docker-compose exec workspace bash ``` * 拉專案 ```shell= # 太極外部 lst-taichi-external.sh # 太極外部(VUE) lst-taichi-external-vue.sh # 太極內部 lst-taichi.sh # API專案 taichi-api.sh # 官網 wuwow-portal.sh # 未知領域求大大填寫 media-source.sh ``` ## 設定@lioshutan/api * Step.1 複製以下程式碼貼上終端機上,windows請使用[git bash](https://gitforwindows.org/)操作 ```bash= cat <<EOF >>~/.ssh/config Host lioshutan HostName gitlab.com User "git" IdentityFile "~/.ssh/lioshutan" EOF ssh-keygen -f lioshutan ``` * Step.2 複製以下程式碼貼上終端機上,windows請使用[git bash](https://gitforwindows.org/)操作 ```bash= cat ~/.ssh/lioshutan.pub ``` 將輸出的結果設定至gitlab的ssh key * Step.3 ```bash= npm i ``` ### 版本號規範 詳細可以參考[版本號規範](https://semver.org/lang/zh-TW/) ``` 版本格式:主版號.次版號.修訂號,版號遞增規則如下: 1. 主版號:當你做了不相容的 API 修改, 2. 次版號:當你做了向下相容的功能性新增, 3. 修訂號:當你做了向下相容的問題修正。 先行版號及版本編譯資訊可以加到「主版號.次版號.修訂號」的後面,作為延伸。 ``` ## 其他 ### 相關markdown套件用法 * Test Graphviz ```graphviz digraph graphname{ a -> b; b -> c; a -> c; } ``` ```graphviz digraph hierarchy { nodesep=1.0 // increases the separation between nodes node [color=Red,fontname=Courier,shape=box] //All nodes will this shape and colour edge [color=Blue, style=dashed] //All the lines look like this Headteacher->{Deputy1 Deputy2 BusinessManager} Deputy1->{Teacher1 Teacher2} BusinessManager->ITManager {rank=same;ITManager Teacher1 Teacher2} // Put them on the same level } ``` * Test UML ```sequence Andrew->China: Says Hello Note right of China: China thinks\nabout it China-->Andrew: How are you? Andrew->>China: I am good thanks! ``` * Test Flow ```flow st=>start: Start:>http://www.google.com[blank] e=>end:>http://www.google.com op1=>operation: My Operation sub1=>subroutine: My Subroutine cond=>condition: Yes or No?:>http://www.google.com io=>inputoutput: catch something... para=>parallel: parallel tasks st->op1->cond cond(yes)->io->e cond(no)->para para(path1, bottom)->sub1(right)->op1 para(path2, top)->op1 ``` * 產生PEM ```shell= openssl rsa -in ~/.ssh/id_rsa -out tmp_file.pem ``` * 連線 ```shell= # (正式)太極內部 ssh -i your.pem ubuntu@lst.wuwow.tw # (正式)太極外部 ssh -i your.pem ubuntu@taichi.wuwow.tw # (正式)太極官網 ssh -i your.pem ubuntu@www.wuwow.tw # (正式)太極API ssh -i your.pem ubuntu@api.wuwow.tw # (測試)太極內部 ssh -i your.pem ubuntu@it-lst-taichi.wuwow.tw # (測試)太極外部 ssh -i your.pem ubuntu@it-lst-taichi-external.wuwow.tw # (正式)太極官網 ssh -i your.pem ubuntu@it-wuwow-portal.wuwow.tw # (測試)太極API ssh -i your.pem ubuntu@it-taichi-api.wuwow.tw ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully