forked from buefy/buefy
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): rewrite installation/ConstructorOptions.vue in TS (#399)
Rewrites `src/pages/installation/ConstructorOptions.vue` in TypeScript. Also renames `src/pages/installation/api/constructor-options.(js → ts). Fixes the issue that Vite complained about the missing `buefy` package, which was not actually used. This was caused by the code snippets `ConstructorOptions.vue`, which Vite conufsed with the actual code and tried to translate them. Moves these code snippets to a separate TypeScript file `usage/constructor-options.ts`.
- Loading branch information
Showing
3 changed files
with
47 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
27 changes: 27 additions & 0 deletions
27
packages/docs/src/pages/installation/usage/constructor-options.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Code snippets used in the `ConstructorOptions` component. | ||
// | ||
// Vite may confuse these examples with the legitimate code and try to compile | ||
// them, if they are in the component (.vue) file. | ||
|
||
export const usageBundle = ` | ||
Vue.use(Buefy, { | ||
defaultIconPack: 'fas', | ||
// ... | ||
})` | ||
|
||
export const usageComponents = ` | ||
import { ConfigProgrammatic, Table, Input } from 'buefy' | ||
Vue.use(Table) | ||
Vue.use(Input) | ||
ConfigProgrammatic.setOptions({ | ||
defaultIconPack: 'fas', | ||
// ... | ||
})` | ||
|
||
export const usageCdn = ` | ||
// When using CDN, Buefy automatically attaches itself on Vue | ||
Vue.prototype.$buefy.config.setOptions({ | ||
defaultIconPack: 'fas', | ||
// ... | ||
})` |