feat: update veui and use <nuxt-link> by default

This commit is contained in:
Justineo 2021-10-20 19:11:09 +08:00
parent e06e507702
commit 0836c8576d
No known key found for this signature in database
GPG Key ID: B73F0979CF18A0EA
4 changed files with 57 additions and 50 deletions

View File

@ -1,33 +1,37 @@
<template> <template>
<main <config-provider :value="config">
:class="{ <main
'post-layout': true, :class="{
'no-links': !hasFooterLinks 'post-layout': true,
}" 'no-links': !hasFooterLinks
> }"
<one-menu :nav="nav"/> >
<nuxt/> <one-menu :nav="nav"/>
<one-footer <nuxt/>
class="footer" <one-footer
:nav="nav" class="footer"
@update="updateLayout" :nav="nav"
/> @update="updateLayout"
<one-back-to-top/> />
</main> <one-back-to-top/>
</main>
</config-provider>
</template> </template>
<script> <script>
import 'focus-visible' import 'focus-visible'
import { ConfigProvider } from 'veui'
import i18nMgr from 'veui/managers/i18n'
import OneMenu from '../components/OneMenu' import OneMenu from '../components/OneMenu'
import OneFooter from '../components/OneFooter' import OneFooter from '../components/OneFooter'
import OneBackToTop from '../components/OneBackToTop' import OneBackToTop from '../components/OneBackToTop'
import nav from '../common/nav' import nav from '../common/nav'
import i18n from '../common/i18n' import i18n from '../common/i18n'
import i18nMgr from 'veui/managers/i18n'
export default { export default {
name: 'main-doc', name: 'main-doc',
components: { components: {
ConfigProvider,
OneMenu, OneMenu,
OneFooter, OneFooter,
OneBackToTop OneBackToTop
@ -35,7 +39,10 @@ export default {
mixins: [i18n], mixins: [i18n],
data () { data () {
return { return {
hasFooterLinks: true hasFooterLinks: true,
config: {
'link.routerLink': 'nuxt-link'
}
} }
}, },
computed: { computed: {

View File

@ -1,11 +1,11 @@
# 自定义校验规则 # 自定义校验规则
对于多值校验,[表单 validators 属性](../components/form#props-validators)提供了比较完善的功能来实现自定义校验。对于单值校验,`Field` 组件内置了 7 种常见规则,具体参考[表单项 rule 属性](../components/field#props-rule)。如果无法覆盖需求,`VEUI` 校验规则模块允许你添加自定义规则。 对于多值校验,`Form` 组件的 [`validators`](../components/form#props-validators) 属性提供了比较完善的功能来实现自定义校验。对于单值校验,`Field` 组件内置了 7 种常见规则,具体参考其 [`rule`](../components/field#props-rule) 属性。如果无法覆盖需求,`VEUI` 校验规则模块允许你添加自定义规则。
## 示例 ## 示例
```js ```js
import ruleManager from 'veui/manager/rule' import ruleManager from 'veui/managers/rule'
ruleManager.addRule('range', { ruleManager.addRule('range', {
validate (value, ruleValue) { validate (value, ruleValue) {
// 仅实现大小校验部分 // 仅实现大小校验部分

52
package-lock.json generated
View File

@ -6174,9 +6174,9 @@
} }
}, },
"babel-plugin-veui": { "babel-plugin-veui": {
"version": "2.1.6", "version": "2.1.7",
"resolved": "https://registry.npmjs.org/babel-plugin-veui/-/babel-plugin-veui-2.1.6.tgz", "resolved": "https://registry.npmjs.org/babel-plugin-veui/-/babel-plugin-veui-2.1.7.tgz",
"integrity": "sha512-dxoa8lR8CJ9RZ09u2lecxz5hk+mtH+KGuiiPy6p7bXMwxkG4ldNJRLLxhVljQ3EZZ9XISvVkVhrPz6ruxoUCcw==", "integrity": "sha512-Fe2D7PUxwVjwDu7uqTHC8k10QeH6e/jNDjeZxoKBsu3MqZeYQIpGjwGsV5zsP+PDE6pDnlvB1rdRpUaxxPfllA==",
"dev": true "dev": true
}, },
"babel-runtime": { "babel-runtime": {
@ -8520,9 +8520,9 @@
"dev": true "dev": true
}, },
"dls-icons-data": { "dls-icons-data": {
"version": "1.9.0", "version": "1.10.0",
"resolved": "https://registry.npmjs.org/dls-icons-data/-/dls-icons-data-1.9.0.tgz", "resolved": "https://registry.npmjs.org/dls-icons-data/-/dls-icons-data-1.10.0.tgz",
"integrity": "sha512-mOqT4YvODPig2cuOg4JcyV2uSB3+epPtjzSiI0ZJzXH+7OIv1DnvpnclUnaT9rFA5+IcQ7zhEL2i104KKufyqA==", "integrity": "sha512-nZ2Dm+8NNpYAtjShTAVUOxd5BRYvcX8oem153TJ70bAp5pVWsGc3kT9Kr8fsKMccufggA2pa/VfwdRgCoNnOtw==",
"dev": true "dev": true
}, },
"dls-icons-vue": { "dls-icons-vue": {
@ -19116,9 +19116,9 @@
} }
}, },
"veui": { "veui": {
"version": "2.1.6", "version": "2.1.7",
"resolved": "https://registry.npmjs.org/veui/-/veui-2.1.6.tgz", "resolved": "https://registry.npmjs.org/veui/-/veui-2.1.7.tgz",
"integrity": "sha512-/UA2FoF+nlUd8m76p3K608jZ9h31eMiR/SsMjsLpkPX7KVhsdLMsQpfz0MenTn569qPbt4X6D9MHoM8Vth+ZaA==", "integrity": "sha512-PIsj4sstlj4mHvUE051DGMNCgIctUTFNcJBf4BU3lvoVkE0wGbiuxAF/5RIkAkJnr/F167urfqfReK4zG74tgw==",
"dev": true, "dev": true,
"requires": { "requires": {
"bytes": "^3.0.0", "bytes": "^3.0.0",
@ -19133,17 +19133,17 @@
}, },
"dependencies": { "dependencies": {
"core-js": { "core-js": {
"version": "3.18.2", "version": "3.18.3",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.2.tgz", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.3.tgz",
"integrity": "sha512-zNhPOUoSgoizoSQFdX1MeZO16ORRb9FFQLts8gSYbZU5FcgXhp24iMWMxnOQo5uIaIG7/6FA/IqJPwev1o9ZXQ==", "integrity": "sha512-tReEhtMReZaPFVw7dajMx0vlsz3oOb8ajgPoHVYGxr8ErnZ6PcYEvvmjGmXlfpnxpkYSdOQttjB+MvVbCGfvLw==",
"dev": true "dev": true
} }
} }
}, },
"veui-loader": { "veui-loader": {
"version": "2.1.6", "version": "2.1.7",
"resolved": "https://registry.npmjs.org/veui-loader/-/veui-loader-2.1.6.tgz", "resolved": "https://registry.npmjs.org/veui-loader/-/veui-loader-2.1.7.tgz",
"integrity": "sha512-37taTU7O/+O9/EkxFFdDi36K4Nq6b2pMBJghcmFafT8pHZi+WtewSSlW82cWQoJovB90n8YTjshmQ7qUF9IzGg==", "integrity": "sha512-pMw5mAMhuqqaHxevBs79vj//yjpmsrr3+Z6wlGlbro2XDKs1mr/1SSlqKXZt5lHPTbmCnXFyEd7bTEEy5LFdww==",
"dev": true, "dev": true,
"requires": { "requires": {
"loader-utils": "^2.0.0", "loader-utils": "^2.0.0",
@ -19233,9 +19233,9 @@
} }
}, },
"veui-theme-dls": { "veui-theme-dls": {
"version": "2.1.6", "version": "2.1.7",
"resolved": "https://registry.npmjs.org/veui-theme-dls/-/veui-theme-dls-2.1.6.tgz", "resolved": "https://registry.npmjs.org/veui-theme-dls/-/veui-theme-dls-2.1.7.tgz",
"integrity": "sha512-8zNAliVB7HO946o11qv7QbvTBtpxduz13bT5+Ri03m1/BbRAN8S6LrHszffkxOxiWoozWjDxMlABP6dDRDYxQQ==", "integrity": "sha512-RQ//mGFND0RjP5fPmyEvNpnMG4eF1m1GwB9gIZJTjKaydOcwXyv7mzleu5y+H4XKfg82YV/HUrtFgAENTadzGw==",
"dev": true, "dev": true,
"requires": { "requires": {
"classlist-polyfill": "^1.2.0", "classlist-polyfill": "^1.2.0",
@ -19243,7 +19243,7 @@
"focus-visible": "^4.1.0", "focus-visible": "^4.1.0",
"less-plugin-dls": "^1.5.0", "less-plugin-dls": "^1.5.0",
"less-plugin-est": "^3.0.0", "less-plugin-est": "^3.0.0",
"veui-theme-dls-icons": "^2.1.6" "veui-theme-dls-icons": "^2.1.7"
}, },
"dependencies": { "dependencies": {
"dls-icons-vue": { "dls-icons-vue": {
@ -19255,21 +19255,21 @@
} }
}, },
"veui-theme-dls-icons": { "veui-theme-dls-icons": {
"version": "2.1.6", "version": "2.1.7",
"resolved": "https://registry.npmjs.org/veui-theme-dls-icons/-/veui-theme-dls-icons-2.1.6.tgz", "resolved": "https://registry.npmjs.org/veui-theme-dls-icons/-/veui-theme-dls-icons-2.1.7.tgz",
"integrity": "sha512-J/CnPjxXNaasqQ56QXCJ/dTHcO1aHV9Qyld8zRDuSLKvNUICKFfBEE2oBB5jKwDvADc9475ZURZc/ZHWA0sWLQ==", "integrity": "sha512-1v/CnDy6Wr35eH4aNaJetHeVriIkcvRSd+ccExtYmKuqK0rx5Od8vvH3CKjiWXCLgc0WZZna+sVigtsWINdFgw==",
"dev": true, "dev": true,
"requires": { "requires": {
"dls-icons-vue": "^1.9.0" "dls-icons-vue": "^1.9.0"
}, },
"dependencies": { "dependencies": {
"dls-icons-vue": { "dls-icons-vue": {
"version": "1.9.0", "version": "1.10.0",
"resolved": "https://registry.npmjs.org/dls-icons-vue/-/dls-icons-vue-1.9.0.tgz", "resolved": "https://registry.npmjs.org/dls-icons-vue/-/dls-icons-vue-1.10.0.tgz",
"integrity": "sha512-42ezBTZFkhEN4fVoCrjoOl36NsRuSlaAmPiLOuUbMBV/sAQW3gon5nU+N1s15PJw2ca4ABYT76gw3KBSU04vew==", "integrity": "sha512-K5bMQFDnhs0myoRbVLOU0nBvHslxjjnNVAZHg0mH5RnJ40kuExgqEgpslghrAEMJ8tlMazGxCK9cOXyZhp8eHg==",
"dev": true, "dev": true,
"requires": { "requires": {
"dls-icons-data": "^1.9.0" "dls-icons-data": "^1.10.0"
} }
} }
} }

View File

@ -24,7 +24,7 @@
"@stackblitz/sdk": "^1.5.2", "@stackblitz/sdk": "^1.5.2",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"babel-plugin-lodash": "^3.3.4", "babel-plugin-lodash": "^3.3.4",
"babel-plugin-veui": "^2.1.6", "babel-plugin-veui": "^2.1.7",
"cheerio": "^1.0.0-rc.10", "cheerio": "^1.0.0-rc.10",
"dls-graphics": "^1.0.0-alpha.3", "dls-graphics": "^1.0.0-alpha.3",
"dls-icons-vue": "^0.14.0", "dls-icons-vue": "^0.14.0",
@ -76,10 +76,10 @@
"stylus-loader": "^3.0.2", "stylus-loader": "^3.0.2",
"unist-util-remove": "^1.0.1", "unist-util-remove": "^1.0.1",
"unist-util-visit": "^1.4.0", "unist-util-visit": "^1.4.0",
"veui": "^2.1.6", "veui": "^2.1.7",
"veui-loader": "^2.1.6", "veui-loader": "^2.1.7",
"veui-theme-dls": "^2.1.6", "veui-theme-dls": "^2.1.7",
"veui-theme-dls-icons": "^2.1.6", "veui-theme-dls-icons": "^2.1.7",
"vue-awesome": "^4.1.0", "vue-awesome": "^4.1.0",
"vue-i18n": "^8.16.0", "vue-i18n": "^8.16.0",
"vue-windows": "^0.2.4" "vue-windows": "^0.2.4"