vuepress-theme-ccds-test
Version:
This is an anime blog theme based on vuepress, the theme is simple, colorful, versatile, and supports customization, providing multiple components to set the theme
25 lines • 868 B
JavaScript
const network = require('../network')
const myData = require('@temp/my-data')
let themeProperty = null
module.exports = {
getAnimeImg(context) {
return new Promise((resolve,reject) => {
new Promise((resolve,reject) => {
for (let i = 0; i < myData.default.length; i++) {
if (myData.default[i].path === '/') {
themeProperty = myData.default[i].frontmatter
}
}
resolve()
})
network.req(themeProperty.animeOption).then(res => {
const query = themeProperty.animeOption.query
const url = res[query]
context.commit('setAnimeImg', {
imgUrl: url
})
resolve()
})
})
},
}