【发布时间】:2021-05-28 15:32:13
【问题描述】:
v-calendar.io上有一个demo,正确的显示结果是日期“2018-01-01”应该有red背景和dark文字:
但我的没有。
我通过CDN导入Vue.js和v-calendar,页面格式为html。
完整代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>vuejs calendar</title>
</head>
<body>
<div id='app'>
<v-calendar :attributes='attrs'>
</v-calendar>
</div>
<!-- 1. Link Vue Javascript -->
<script src='https://unpkg.com/vue/dist/vue.js'></script>
<!-- 2. Link VCalendar Javascript (Plugin automatically installed) -->
<script src='https://unpkg.com/v-calendar'></script>
<!--3. Create the Vue instance-->
<script>
new Vue({
el: '#app',
data() {
return {
attrs: [
{
key: 'today',
highlight: {
backgroundColor: '#ff8080',
},
// Just use a normal style
contentStyle: {
color: '#fafafa',
},
dates: new Date(2018, 0, 1)
},
],
};
},
})
</script>
</body>
</html>
【问题讨论】:
-
您是否尝试过使用未来的日期?我认为过去的日期是由 v-calendar 组件自动格式化的。
-
@sandman 试过了,还是一样。
标签: javascript css vue.js vue-component v-calendar.io