router hash --> web 完善 utterances 集成

This commit is contained in:
就眠儀式 2021-12-16 00:42:43 +08:00
parent 9e828af4ed
commit d2ae215227
7 changed files with 12 additions and 18 deletions

View File

@ -19,6 +19,7 @@
<li>[新增] tooltip 组件, 便捷的信息提示</li> <li>[新增] tooltip 组件, 便捷的信息提示</li>
<li>[新增] input-number 组件, 数字输入框, 方便数字录入。</li> <li>[新增] input-number 组件, 数字输入框, 方便数字录入。</li>
<li>[加强] layer 组件 area 属性, 支持 字符串 与 数组 类型, 默认为 auto 宽高自适应。</li> <li>[加强] layer 组件 area 属性, 支持 字符串 与 数组 类型, 默认为 auto 宽高自适应。</li>
<li>[集成] utteranc.es 文档评论。</li>
<li>[升级] layer-vue 1.1.7。</li> <li>[升级] layer-vue 1.1.7。</li>
</ul> </ul>
</li> </li>

View File

@ -4,18 +4,12 @@
<script> <script>
export default { export default {
name: 'Utterances', name: 'Utterances',
props: {
id: {
type: Number,
default: 6
}
},
methods: { methods: {
initValine () { initValine () {
const utterances = document.createElement('script'); const utterances = document.createElement('script');
utterances.type = 'text/javascript'; utterances.type = 'text/javascript';
utterances.async = true; utterances.async = true;
utterances.setAttribute('issue-number', this.id) utterances.setAttribute('issue-term', 'pathname')
utterances.setAttribute('theme','github-light') utterances.setAttribute('theme','github-light')
utterances.setAttribute('repo',`layui-vue/layui-vue`) utterances.setAttribute('repo',`layui-vue/layui-vue`)
utterances.crossorigin = 'anonymous'; utterances.crossorigin = 'anonymous';

View File

@ -14,9 +14,7 @@ export function createApp(): {
router: Router router: Router
} { } {
const app = const app =
import.meta.env.MODE === 'production' import.meta.env.MODE === 'production' ? createSSRApp(Layout) : _createApp(Layout)
? createSSRApp(Layout)
: _createApp(Layout)
const router = createRouter() const router = createRouter()
app app

View File

@ -1,6 +1,7 @@
import { import {
createRouter as _createRouter, createRouter as _createRouter,
createWebHashHistory, createWebHashHistory,
createWebHistory,
Router, Router,
} from 'vue-router' } from 'vue-router'
import zhCN from './zh-CN' import zhCN from './zh-CN'
@ -10,7 +11,7 @@ const routes = [...zhCN]
export function createRouter(): Router { export function createRouter(): Router {
const baseUrl = import.meta.env.BASE_URL const baseUrl = import.meta.env.BASE_URL
return _createRouter({ return _createRouter({
history: createWebHashHistory(baseUrl), history: createWebHistory(baseUrl),
routes: routes, routes: routes,
}) })
} }

View File

@ -49,9 +49,9 @@ const zhCN = [
meta: { title: '问题' }, meta: { title: '问题' },
}, },
{ {
path: '/zh-CN/guide/contribution', path: '/zh-CN/guide/team',
component: () => import('../../docs/zh-CN/guide/contribution.md'), component: () => import('../../docs/zh-CN/guide/contribution.md'),
meta: { title: '贡献' }, meta: { title: '团队' },
}, },
{ {
path: '/zh-CN/guide/norms', path: '/zh-CN/guide/norms',

View File

@ -100,9 +100,9 @@ export default {
}, },
{ {
id: 6, id: 6,
title: '贡献', title: '团队',
subTitle: 'contribution', subTitle: 'team',
path: '/zh-CN/guide/contribution', path: '/zh-CN/guide/team',
} }
], ],
}, },

View File

@ -44,7 +44,7 @@ const allLeftChange = function (checked: any) {
watch( watch(
leftSelectedKeys, leftSelectedKeys,
function () { () => {
if ( if (
leftDataSource.value.length === leftSelectedKeys.value.length && leftDataSource.value.length === leftSelectedKeys.value.length &&
leftDataSource.value.length != 0 leftDataSource.value.length != 0
@ -70,7 +70,7 @@ const allRightChange = function (checked: any) {
watch( watch(
rightSelectedKeys, rightSelectedKeys,
function () { () => {
if ( if (
rightDataSource.value.length === rightSelectedKeys.value.length && rightDataSource.value.length === rightSelectedKeys.value.length &&
rightDataSource.value.length != 0 rightDataSource.value.length != 0