muerwre.github.io/api/_content/query/Llpj9LBd4i.json
muerwre 178a904adc commit db7ac717d3ca823f51df7d2087bb9fbf94e2fb95
Author: Fedor Katurov <gotham48@gmail.com>
Date:   Thu Nov 3 11:29:19 2022 +0600

    fixed proportions
2022-11-03 05:30:56 +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-2e37c2"},"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-35641a"},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"class":"ct-9933df"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-304141"},"children":[{"type":"text","value":"axios"}]},{"type":"element","tag":"span","props":{"class":"ct-9933df"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-35641a"},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"class":"ct-9933df"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-ee4298"},"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-a6d486"},"children":[{"type":"text","value":"declare"}]},{"type":"element","tag":"span","props":{"class":"ct-9933df"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-a6d486"},"children":[{"type":"text","value":"module"}]},{"type":"element","tag":"span","props":{"class":"ct-9933df"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-ee4298"},"children":[{"type":"text","value":"'vue'"}]},{"type":"element","tag":"span","props":{"class":"ct-9933df"},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-9933df"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-a6d486"},"children":[{"type":"text","value":"interface"}]},{"type":"element","tag":"span","props":{"class":"ct-9933df"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-b8ca8f"},"children":[{"type":"text","value":"ComponentCustomProperties"}]},{"type":"element","tag":"span","props":{"class":"ct-9933df"},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-9933df"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-9933df"},"children":[{"type":"text","value":" "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-3ceb5e"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-2d3cbb"},"children":[{"type":"text","value":"$translate"}]},{"type":"element","tag":"span","props":{"class":"ct-fccd37"},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"class":"ct-3ceb5e"},"children":[{"type":"text","value":" ("}]},{"type":"element","tag":"span","props":{"class":"ct-108723"},"children":[{"type":"text","value":"key"}]},{"type":"element","tag":"span","props":{"class":"ct-fccd37"},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"class":"ct-3ceb5e"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-21a6c5"},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"class":"ct-3ceb5e"},"children":[{"type":"text","value":") "}]},{"type":"element","tag":"span","props":{"class":"ct-0b9226"},"children":[{"type":"text","value":"=>"}]},{"type":"element","tag":"span","props":{"class":"ct-3ceb5e"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-21a6c5"},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-9933df"},"children":[{"type":"text","value":" }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-9933df"},"children":[{"type":"text","value":"}"}]}]}]}]}]},{"type":"element","tag":"style","children":[{"type":"text","value":".ct-0b9226{color:#FF7B72}.ct-21a6c5{color:#79C0FF}.ct-108723{color:#FFA657}.ct-fccd37{color:#FF7B72}.ct-2d3cbb{color:#D2A8FF}.ct-3ceb5e{color:#C9D1D9}.ct-b8ca8f{color:#FFA657}.ct-a6d486{color:#FF7B72}.ct-ee4298{color:#A5D6FF}.ct-304141{color:#C9D1D9}.ct-9933df{color:#C9D1D9}.ct-35641a{color:#FF7B72}.ct-2e37c2{color:#8B949E}.light .ct-2e37c2{color:#93A1A1}.light .ct-35641a{color:#859900}.light .ct-9933df{color:#657B83}.light .ct-304141{color:#268BD2}.light .ct-ee4298{color:#2AA198}.light .ct-a6d486{color:#073642}.light .ct-b8ca8f{color:#268BD2}.light .ct-3ceb5e{color:#657B83}.light .ct-2d3cbb{color:#268BD2}.light .ct-fccd37{color:#859900}.light .ct-108723{color:#657B83}.light .ct-21a6c5{color:#859900}.light .ct-0b9226{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"}