日期格式化
This commit is contained in:
@@ -1 +1 @@
|
||||
<%- js('js/mobile.cfb38e2874478d984279.js') %> <%- js('js/slider.5ca5d3094d7d23f182cf.js') %> <%- js('js/main.34802c21ea4824f2ae00.js') %>
|
||||
<%- js('js/mobile.cfb38e2874478d984279.js') %> <%- js('js/slider.f9a33fdc5a046f675ae0.js') %> <%- js('js/main.34802c21ea4824f2ae00.js') %>
|
||||
@@ -85,19 +85,19 @@
|
||||
</p>
|
||||
<li class="search-li" v-for="item in items" v-show="!item.isHide">
|
||||
<a :href="item.path|urlformat" class="search-title"><i class="icon-quo-left icon"></i>
|
||||
<span>{{item.title}}</span>
|
||||
<span v-text="item.title"></span>
|
||||
</a>
|
||||
<p class="search-time">
|
||||
<i class="icon-calendar icon"></i>
|
||||
<span >{{item.date|dateformat}}</span>
|
||||
<span v-text="item.date"></span>
|
||||
</p>
|
||||
<p class="search-category" v-if="item.categories.length">
|
||||
<i class="icon-book icon" ></i>
|
||||
<span v-for="category in item.categories" @click="chose(category.name, '$')" >{{category.name}}</span>
|
||||
<span v-for="category in item.categories" @click="chose(category.name, '$')" v-text="category.name"></span>
|
||||
</p>
|
||||
<p class="search-tag" v-if="item.tags.length">
|
||||
<i class="icon-price-tags icon" ></i>
|
||||
<span v-for="tag in item.tags" @click="chose(tag.name, '#')" >{{tag.name}}</span>
|
||||
<span v-for="tag in item.tags" @click="chose(tag.name, '#')" v-text="tag.name"></span>
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -8,18 +8,13 @@ import Vue from './vue.min'
|
||||
|
||||
const isMobile = (Browser.versions.mobile && window.screen.width < 800)
|
||||
|
||||
function fixzero(str) {
|
||||
str = str + ''
|
||||
return str.length === 1 ? '0' + str : str
|
||||
}
|
||||
|
||||
function setScrollZero() {
|
||||
let $sct = document.querySelectorAll('.tools-section')
|
||||
Array.prototype.forEach.call($sct, (em) => {
|
||||
em.scrollTop = 0
|
||||
})
|
||||
}
|
||||
let vm = new Vue({
|
||||
new Vue({
|
||||
el: '#container',
|
||||
data: {
|
||||
isCtnShow: false,
|
||||
@@ -64,14 +59,7 @@ let vm = new Vue({
|
||||
},
|
||||
filters: {
|
||||
urlformat: (str) => {
|
||||
if (window.yiliaConfig && window.yiliaConfig.root) {
|
||||
return window.yiliaConfig.root + str
|
||||
}
|
||||
return '/' + str
|
||||
},
|
||||
dateformat: (str) => {
|
||||
let d = new Date(str)
|
||||
return d.getFullYear() + '-' + fixzero((d.getMonth() + 1)) + '-' + fixzero(d.getDate())
|
||||
return (window.yiliaConfig && window.yiliaConfig.root) ? window.yiliaConfig.root + str : '/' + str;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user