-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add initial plugin functionality with USWDS setting definitions
ISSUES CLOSED: #99
- Loading branch information
1 parent
7a39e09
commit ffa2408
Showing
2 changed files
with
31 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import pkg from '../package.json' | ||
import { nextId } from '@/utils/unique-id.js' | ||
|
||
export default { | ||
install: (app, options) => { | ||
const customOptions = options || {} | ||
|
||
const vueUswdsOptions = { | ||
prefixSeparator: ':', | ||
gridNamespace: 'grid-', | ||
utilityNamespace: 'u-', | ||
imagePath: '/assets', | ||
svgSpritePath: '/assets/sprite', | ||
...customOptions, | ||
version: pkg.version, | ||
} | ||
|
||
if (!app.config.globalProperties.$vueUswds) { | ||
app.config.globalProperties.$vueUswds = vueUswdsOptions | ||
} | ||
|
||
app.provide('vueUswds', vueUswdsOptions) | ||
app.provide('nextId', () => nextId(app.config.globalProperties)) | ||
}, | ||
} |
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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
import '../node_modules/uswds/dist/css/uswds.min.css' | ||
import { createApp } from 'vue' | ||
import App from './App.vue' | ||
import vueUswds from '@/index.js' | ||
import App from '@/App.vue' | ||
|
||
createApp(App).mount('#app') | ||
const app = createApp(App) | ||
app.use(vueUswds, {}) | ||
app.mount('#app') |