muerwre.github.io/api/_content/query/Llpj9LBd4i.json
muerwre cf4fa8656b commit 387fa7ce1b
Author: Fedor Katurov <gotham48@gmail.com>
Date:   Fri Nov 11 17:27:44 2022 +0600

    fixed colors on writing.svg
2022-11-11 11:29:35 +00:00

1 line
No EOL
8.6 KiB
JSON

{"_path":"/frontend/vue/adding-global-properties-to-component","_dir":"vue","_draft":false,"_partial":false,"_locale":"en","_empty":false,"title":"Adding Global Properties To Component","description":"The topic's fully covered in the official documentation and in Add global variable to window.","excerpt":{"type":"root","children":[{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"The topic's fully covered in the "},{"type":"element","tag":"a","props":{"href":"https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties","rel":["nofollow"]},"children":[{"type":"text","value":"official documentation"}]},{"type":"text","value":" and in "},{"type":"element","tag":"a","props":{"href":"Add%20global%20variable%20to%20window"},"children":[{"type":"text","value":"Add global variable to window"}]},{"type":"text","value":"."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"For example, you want to add global "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"$http"}]},{"type":"text","value":" and "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"$translate"}]},{"type":"text","value":" services to all of project's components:"}]},{"type":"element","tag":"code","props":{"code":"// ~/index.d.ts or ~/custom.d.ts\n\nimport axios from 'axios'\n\ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $http: typeof axios\n $translate: (key: string) => string\n }\n}\n","language":"typescript"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"// ~/index.d.ts or ~/custom.d.ts\n\nimport axios from 'axios'\n\ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $http: typeof axios\n $translate: (key: string) => string\n }\n}\n"}]}]}]}]},"body":{"type":"root","children":[{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"The topic's fully covered in the "},{"type":"element","tag":"a","props":{"href":"https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties","rel":["nofollow"]},"children":[{"type":"text","value":"official documentation"}]},{"type":"text","value":" and in "},{"type":"element","tag":"a","props":{"href":"Add%20global%20variable%20to%20window"},"children":[{"type":"text","value":"Add global variable to window"}]},{"type":"text","value":"."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"For example, you want to add global "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"$http"}]},{"type":"text","value":" and "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"$translate"}]},{"type":"text","value":" services to all of project's components:"}]},{"type":"element","tag":"code","props":{"code":"// ~/index.d.ts or ~/custom.d.ts\n\nimport axios from 'axios'\n\ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $http: typeof axios\n $translate: (key: string) => string\n }\n}\n","language":"typescript"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-38c94d"},"children":[{"type":"text","value":"// ~/index.d.ts or ~/custom.d.ts"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-a17a19"},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"class":"ct-155b17"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-7874ed"},"children":[{"type":"text","value":"axios"}]},{"type":"element","tag":"span","props":{"class":"ct-155b17"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-a17a19"},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"class":"ct-155b17"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-e4d0e5"},"children":[{"type":"text","value":"'axios'"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-9aa972"},"children":[{"type":"text","value":"declare"}]},{"type":"element","tag":"span","props":{"class":"ct-155b17"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-9aa972"},"children":[{"type":"text","value":"module"}]},{"type":"element","tag":"span","props":{"class":"ct-155b17"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-e4d0e5"},"children":[{"type":"text","value":"'vue'"}]},{"type":"element","tag":"span","props":{"class":"ct-155b17"},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-155b17"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-9aa972"},"children":[{"type":"text","value":"interface"}]},{"type":"element","tag":"span","props":{"class":"ct-155b17"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-14aa9a"},"children":[{"type":"text","value":"ComponentCustomProperties"}]},{"type":"element","tag":"span","props":{"class":"ct-155b17"},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-155b17"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-155b17"},"children":[{"type":"text","value":" "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-7be3cd"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-057ea8"},"children":[{"type":"text","value":"$translate"}]},{"type":"element","tag":"span","props":{"class":"ct-f32db9"},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"class":"ct-7be3cd"},"children":[{"type":"text","value":" ("}]},{"type":"element","tag":"span","props":{"class":"ct-d96900"},"children":[{"type":"text","value":"key"}]},{"type":"element","tag":"span","props":{"class":"ct-f32db9"},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"class":"ct-7be3cd"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-d39c51"},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"class":"ct-7be3cd"},"children":[{"type":"text","value":") "}]},{"type":"element","tag":"span","props":{"class":"ct-865531"},"children":[{"type":"text","value":"=>"}]},{"type":"element","tag":"span","props":{"class":"ct-7be3cd"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-d39c51"},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-155b17"},"children":[{"type":"text","value":" }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-155b17"},"children":[{"type":"text","value":"}"}]}]}]}]}]},{"type":"element","tag":"style","children":[{"type":"text","value":".ct-865531{color:#FF7B72}.ct-d39c51{color:#79C0FF}.ct-d96900{color:#FFA657}.ct-f32db9{color:#FF7B72}.ct-057ea8{color:#D2A8FF}.ct-7be3cd{color:#C9D1D9}.ct-14aa9a{color:#FFA657}.ct-9aa972{color:#FF7B72}.ct-e4d0e5{color:#A5D6FF}.ct-7874ed{color:#C9D1D9}.ct-155b17{color:#C9D1D9}.ct-a17a19{color:#FF7B72}.ct-38c94d{color:#8B949E}.light .ct-38c94d{color:#93A1A1}.light .ct-a17a19{color:#859900}.light .ct-155b17{color:#657B83}.light .ct-7874ed{color:#268BD2}.light .ct-e4d0e5{color:#2AA198}.light .ct-9aa972{color:#073642}.light .ct-14aa9a{color:#268BD2}.light .ct-7be3cd{color:#657B83}.light .ct-057ea8{color:#268BD2}.light .ct-f32db9{color:#859900}.light .ct-d96900{color:#657B83}.light .ct-d39c51{color:#859900}.light .ct-865531{color:#073642}"}]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[]}},"_type":"markdown","_id":"content:Frontend:Vue:Adding global properties to component.md","_source":"content","_file":"Frontend/Vue/Adding global properties to component.md","_extension":"md"}