|
import prompt from '@system.prompt'
export default {
data: {
authors: [
{
name: "李白",
poems: [
"君不见,黄河之水天上来,奔流到海不复回。",
"床前明月光,疑是地上霜。",
"长风破浪会有时,直挂云帆济沧海。"
]
},
{
name: "杜甫",
poems: [
"正是江南好风景,落花时节又逢君。",
"会当凌绝顶,一览众山小。",
"国破山河在,城春草木深。"
]
},
{
name: "李商隐",
poems: [
"相见时难别亦难,东风无力百花残。",
"此情可待成追忆,只是当时已惘然。",
"春蚕到死丝方尽,蜡炬成灰泪始干。"
]
}
]
},
authorChange(e) {
// 可以在这里处理作者切换的逻辑
console.log("切换到作者:", this.authors[e.index].name);
console.log(e)
prompt.showToast({
message: this.authors[e.index].name
})
},
poemChange(authorIndex) {
// 可以在这里处理诗歌切换的逻辑
console.log("作者", this.authors[authorIndex].name, "切换到诗:");
}
}
.container {
flex-direction: column;
width: 100%;
height: 100%;
}
.outer-swiper {
width: 100%;
height: 100%;
}
.author-page {
width: 100%;
height: 100%;
}
.inner-swiper {
width: 100%;
height: 100%;
}
.poem-page {
width: 100%;
height: 100%;
justify-content: center;
align-items: center;
background-color: #f0f0f0;
}
开发工具上外层可以左右滑动,手机上不可以 |
|