feat: tc-comment

This commit is contained in:
theajack 2021-01-27 01:40:43 +08:00
parent 5fa871e2b9
commit af818a8f01
7 changed files with 570 additions and 545 deletions

1044
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -53,6 +53,7 @@
"husky": "^3.1.0",
"less": "^3.9.0",
"less-loader": "^5.0.0",
"tc-comment": "0.0.3",
"ts-loader": "^6.2.1",
"typescript": "^3.7.4",
"vue": "^2.5.2",

View File

@ -14,6 +14,9 @@
</style>
</head>
<body style="margin: 0">
<div id='comment'>
</div>
<div id='drawArea'></div>
<script src="./bundle.js"></script>
</body>

View File

@ -29,7 +29,10 @@ import '../src/cnchar/plugin/radical';
// import '../npm/idiom/cnchar.idiom.min.js';
// import '../npm/xhy/cnchar.xhy.min.js';
// import '../npm/radical/cnchar.radical.min.js';
import initComment from 'tc-comment';
initComment({
el: '#app'
});
console.log(cnchar);

View File

@ -51,11 +51,14 @@
</div>
</div>
<div class='copy-right'>MIT Licensed | Copyright © 2020 present <a href='https://www.github.com/theajack' target='view_window'>theajack</a></div>
<div id='comment'>
</div>
</div>
</template>
<script>
import initComment from 'tc-comment';
export default {
data () {
return {
@ -104,13 +107,14 @@
}
},
mounted () {
let timer = setInterval(() => {
let comment = document.getElementById('vcomments');
if (comment) {
comment.className += ' home-comment';
clearInterval(timer);
}
}, 500);
initComment({el: '#comment'});
// let timer = setInterval(() => {
// let comment = document.getElementById('vcomments');
// if (comment) {
// comment.className += ' home-comment';
// clearInterval(timer);
// }
// }, 500);
}
};
</script>

View File

@ -159,22 +159,22 @@ module.exports = {
// baseURL: 'https://gitee.com', // 平台的 base URL
// },
// ], // 平台的 base URL
[
'vuepress-plugin-comment',
{
choosen: 'valine',
// options选项中的所有参数会传给Valine的配置
options: {
el: '#vcomments',
appId: 'azSK2mRA57Pa2Y0NEWxXjrdJ-gzGzoHsz',
appKey: 'Ky1y1SbwcyYkHMEbdVeq6mnf',
notify: false,
verify: false,
avatar: 'mp',
placeholder: '留下点什么吧...'
}
}
]
// [
// 'vuepress-plugin-comment',
// {
// choosen: 'valine',
// // options选项中的所有参数会传给Valine的配置
// options: {
// el: '#vcomments',
// appId: 'azSK2mRA57Pa2Y0NEWxXjrdJ-gzGzoHsz',
// appKey: 'Ky1y1SbwcyYkHMEbdVeq6mnf',
// notify: false,
// verify: false,
// avatar: 'mp',
// placeholder: '留下点什么吧...'
// }
// }
// ]
],
// vuepress里修改webpack配置使用的是chainWebpack进行链式调用

View File

@ -12,7 +12,15 @@ module.exports = {
contentBase: path.resolve('./', 'public'),
historyApiFallback: true,
inline: true,
host: 'localhost'// '0.0.0.0' //
host: 'localhost', // '0.0.0.0' //
proxy: {
'/api': {
target: 'https://shiyix.cn/',
// pathRewrite: {'^/remote': ''},
changeOrigin: true,
secure: false
}
}
},
resolve: {
extensions: [ '.tsx', '.ts', '.js' ]