快速网站建设价格,根据链接获取网站名称,汕头seo课程培训,在线二维码制作效果图 1.创建数据 content.js
import { reactive } from vueconst data reactive({color:red,title: 二十四节气,subTitle: 节气#xff0c;是干支历中表示自然节律变化以及确立“十二月建”#xff08;月令#xff09;的特定节令。,list: [{name: 立春,con…效果图 1.创建数据 content.js
import { reactive } from vueconst data reactive({color:red,title: 二十四节气,subTitle: 节气是干支历中表示自然节律变化以及确立“十二月建”月令的特定节令。,list: [{name: 立春,content: 立春为二十四节气之首。立是“开始”之意春代表着温暖、生长。,imgUrl: require(../assets/images/01.png)},{name: 雨水,content: 雨水是二十四节气之第2个节气。,imgUrl: require(../assets/images/02.png)},{name: 惊蛰,content: 惊蛰是二十四节气中的第三个节气。,imgUrl: require(../assets/images/03.png)},{name: 春分,content: 春分是二十四节气之一春季第四个节气。,imgUrl: require(../assets/images/04.png)},{name: 清明,content: 清明是二十四节气之一春季的第五个节气。,imgUrl: require(../assets/images/05.png)},{name: 谷雨,content: 谷雨是二十四节气之第6个节气春季的最后一个节气。,imgUrl: require(../assets/images/06.png)},{name: 立夏,content: 立夏是二十四节气中的第7个节气夏季的第一个节气交节时间在每年公历5月05-07日。,imgUrl: require(../assets/images/07.png)},{name: 小满,content: 小满二十四节气中的第八个节气也是夏季的第二个节气。,imgUrl: require(../assets/images/08.png)},{name: 芒种,content: 芒种是二十四节气之第九个节气夏季的第三个节气干支历午月的起始。,imgUrl: require(../assets/images/09.png)},{name: 夏至,content: 夏至是二十四节气的第10个节气。,imgUrl: require(../assets/images/10.png)},{name: 小暑,content: 小暑是二十四节气之第十一个节气干支历午月的结束以及未月的起始。,imgUrl: require(../assets/images/11.png)},{name: 大暑,content: 大暑是二十四节气中的第十二个节气也是夏季最后一个节气。,imgUrl: require(../assets/images/12.png)},{name: 立秋,content: 立秋是“二十四节气”之第十三个节气也是秋季的起始。,imgUrl: require(../assets/images/13.png)},{name: 处暑,content: 处暑是二十四节气之第十四个节气也是秋季的第二个节气。,imgUrl: require(../assets/images/15.png)},{name: 白露,content: 白露是“二十四节气”中的第15个节气秋季第3个节气干支历申月的结束与酉月的起始。,imgUrl: require(../assets/images/16.png)},{name: 秋分,content: 秋分是二十四节气之第十六个节气秋季第四个节气。,imgUrl: require(../assets/images/17.png)},{name: 寒露,content: 寒露是二十四节气之第十七个节气秋季的第五个节气。,imgUrl: require(../assets/images/18.png)},{name: 霜降,content: 霜降是二十四节气中的第十八个节气秋季的最后一个节气。,imgUrl: require(../assets/images/19.png)},{name: 立冬,content: 立冬是二十四节气之第十九个节气也是冬季的起始。,imgUrl: require(../assets/images/20.png)},{name: 小雪,content: 小雪是二十四节气中的第20个节气冬季第2个节气。,imgUrl: require(../assets/images/21.png)},{name: 大雪,content: 大雪是二十四节气中的第21个节气冬季的第三个节气。,imgUrl: require(../assets/images/22.png)},{name: 冬至,content: 冬至又称日南至、冬节、亚岁等兼具自然与人文两大内涵既是二十四节气中一个重要的节气也是中国民间的传统祭祖节日。,imgUrl: require(../assets/images/23.png)},{name: 小寒,content: 小寒是二十四节气中的第23个节气冬季的第5个节气干支历子月的结束与丑月的起始。,imgUrl: require(../assets/images/24.png)},{name: 大寒,content: 大寒是二十四节气中的最后一个节气。,imgUrl: require(../assets/images/25.png)}]
})export default data2.在app.vue 引入
templatediv idapph3 classtitle{{ data.title }}/h3div classsubtitle{{ data.subTitle }}/div/div
/templatescript setup
import data from ./stare/content.js;
/script
3封装成组件headTitle
headTitle.vue
templateh3 classtitle{{ title }}/h3div classsubtitle{{ subTitle }}/div
/template
script setup
import { defineProps } from vue;
defineProps({title: {type: String,default: 默认标题,},subTitle: {type: String,default: 默认子标题,}
});
/scriptapp.vue
templatediv idappheadTitle :titledata.title :subTitledata.subTitle //div
/template
script setup
import data from ./stare/content.js;
import headTitle from ./headTitle.vue
/script4列表循环
app.vue
templatediv idappheadTitle :titledata.title :subTitledata.subTitle /div classcontdiv v-for(item, index) in data.list :keyindex classlistdiv classimgimg :srcitem.imgUrl //divdiv classname{{ item.name }}/divdiv classcontent{{ item.content }}/div/div/div/div
/template
script setup
import data from ./stare/content.js;
import headTitle from ./headTitle.vue
/script5封装list 内容 list.vue
templatediv classcontdiv v-for(item, index) in list :keyindex classlistdiv classimgimg :srcitem.imgUrl //divdiv classname{{ item.name }}/divdiv classcontent{{ item.content }}/div/div/div
/template
script setup
import { defineProps } from vue;
defineProps({list: {type: Array},
});
/scriptapp.vue
templatediv idappheadTitle :titledata.title :subTitledata.subTitle /list :listdata.list//div
/template
script setup
import data from ./stare/content.js;
import headTitle from ./headTitle.vue
import list from ./list.vue
/script6封装 headTitle 和 list cont.vue
templatediv :style{ color: color }ppp/divheadTitle :titledatas.title :subTitledatas.subTitle /listComponent :listdatas.list /
/template
script setup
import headTitle from ./headTitle.vue;
import listComponent from ./list.vue;
import { computed, defineProps } from vue;
const props defineProps({datas: {type: Object,default: () ({}),},
});
console.log(props.datas.color);
const color computed(() {return props.datas.color;
});
/script
style
/styleapp.vue 模拟api 请求数据
templatediv idappcont :datasdata/cont/div
/templatescript setup
import { ref } from vue;
import cont from ./components/cont.vue;
const data ref({});
setTimeout(() {import(./stare/content.js).then((res) {console.log(res.default);data.value res.default;});
}, 1000);
/script
文章转载自: http://www.morning.rymb.cn.gov.cn.rymb.cn http://www.morning.bswxt.cn.gov.cn.bswxt.cn http://www.morning.tgyzk.cn.gov.cn.tgyzk.cn http://www.morning.slkqd.cn.gov.cn.slkqd.cn http://www.morning.pqxjq.cn.gov.cn.pqxjq.cn http://www.morning.hpkgm.cn.gov.cn.hpkgm.cn http://www.morning.dmchips.com.gov.cn.dmchips.com http://www.morning.sqhtg.cn.gov.cn.sqhtg.cn http://www.morning.nlzpj.cn.gov.cn.nlzpj.cn http://www.morning.mtsck.cn.gov.cn.mtsck.cn http://www.morning.pgxjl.cn.gov.cn.pgxjl.cn http://www.morning.rkmhp.cn.gov.cn.rkmhp.cn http://www.morning.jqtb.cn.gov.cn.jqtb.cn http://www.morning.qrsm.cn.gov.cn.qrsm.cn http://www.morning.brwnd.cn.gov.cn.brwnd.cn http://www.morning.wxrbl.cn.gov.cn.wxrbl.cn http://www.morning.kstgt.cn.gov.cn.kstgt.cn http://www.morning.jwrcz.cn.gov.cn.jwrcz.cn http://www.morning.kxymr.cn.gov.cn.kxymr.cn http://www.morning.nqmdc.cn.gov.cn.nqmdc.cn http://www.morning.nqwz.cn.gov.cn.nqwz.cn http://www.morning.bmqls.cn.gov.cn.bmqls.cn http://www.morning.bqyb.cn.gov.cn.bqyb.cn http://www.morning.txnqh.cn.gov.cn.txnqh.cn http://www.morning.rqgq.cn.gov.cn.rqgq.cn http://www.morning.gsjzs.cn.gov.cn.gsjzs.cn http://www.morning.xqcbz.cn.gov.cn.xqcbz.cn http://www.morning.gwdnl.cn.gov.cn.gwdnl.cn http://www.morning.tcxk.cn.gov.cn.tcxk.cn http://www.morning.wnhsw.cn.gov.cn.wnhsw.cn http://www.morning.bpmdh.cn.gov.cn.bpmdh.cn http://www.morning.gjlml.cn.gov.cn.gjlml.cn http://www.morning.wdply.cn.gov.cn.wdply.cn http://www.morning.nzms.cn.gov.cn.nzms.cn http://www.morning.rlbc.cn.gov.cn.rlbc.cn http://www.morning.rhpy.cn.gov.cn.rhpy.cn http://www.morning.deanzhu.com.gov.cn.deanzhu.com http://www.morning.jikuxy.com.gov.cn.jikuxy.com http://www.morning.qgtfl.cn.gov.cn.qgtfl.cn http://www.morning.wkcl.cn.gov.cn.wkcl.cn http://www.morning.nrfqd.cn.gov.cn.nrfqd.cn http://www.morning.bdkhl.cn.gov.cn.bdkhl.cn http://www.morning.monstercide.com.gov.cn.monstercide.com http://www.morning.pfggj.cn.gov.cn.pfggj.cn http://www.morning.zqnmp.cn.gov.cn.zqnmp.cn http://www.morning.hous-e.com.gov.cn.hous-e.com http://www.morning.mbdbe.cn.gov.cn.mbdbe.cn http://www.morning.tgtsg.cn.gov.cn.tgtsg.cn http://www.morning.pftjj.cn.gov.cn.pftjj.cn http://www.morning.paxkhqq.cn.gov.cn.paxkhqq.cn http://www.morning.ptmsk.cn.gov.cn.ptmsk.cn http://www.morning.pctsq.cn.gov.cn.pctsq.cn http://www.morning.jlgjn.cn.gov.cn.jlgjn.cn http://www.morning.lyhrg.cn.gov.cn.lyhrg.cn http://www.morning.nlrxh.cn.gov.cn.nlrxh.cn http://www.morning.yxplz.cn.gov.cn.yxplz.cn http://www.morning.fbccx.cn.gov.cn.fbccx.cn http://www.morning.tndxg.cn.gov.cn.tndxg.cn http://www.morning.czlzn.cn.gov.cn.czlzn.cn http://www.morning.yqyhr.cn.gov.cn.yqyhr.cn http://www.morning.sgpnz.cn.gov.cn.sgpnz.cn http://www.morning.msgnx.cn.gov.cn.msgnx.cn http://www.morning.ltpzr.cn.gov.cn.ltpzr.cn http://www.morning.wgkz.cn.gov.cn.wgkz.cn http://www.morning.pdmsj.cn.gov.cn.pdmsj.cn http://www.morning.cylbs.cn.gov.cn.cylbs.cn http://www.morning.ylqb8.cn.gov.cn.ylqb8.cn http://www.morning.rsmtx.cn.gov.cn.rsmtx.cn http://www.morning.tbknh.cn.gov.cn.tbknh.cn http://www.morning.qjldz.cn.gov.cn.qjldz.cn http://www.morning.xtyyg.cn.gov.cn.xtyyg.cn http://www.morning.ldqrd.cn.gov.cn.ldqrd.cn http://www.morning.dncgb.cn.gov.cn.dncgb.cn http://www.morning.zfqr.cn.gov.cn.zfqr.cn http://www.morning.qdzqf.cn.gov.cn.qdzqf.cn http://www.morning.wgzzj.cn.gov.cn.wgzzj.cn http://www.morning.zrbpx.cn.gov.cn.zrbpx.cn http://www.morning.grnhb.cn.gov.cn.grnhb.cn http://www.morning.ldcrh.cn.gov.cn.ldcrh.cn http://www.morning.kqkmx.cn.gov.cn.kqkmx.cn