前端学习(2368):编程式导航
生活随笔
收集整理的這篇文章主要介紹了
前端学习(2368):编程式导航
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
<template><view><button type="primary" @click="chooseImg">上傳圖片</button><image v-for="item in imgArr" :src="item" @click="previewImg(item)"></image><navigator url="../content/content" open-type="switchTab">跳轉(zhuǎn)</navigator><navigator url="../detail/detail" open-type="redirect">跳轉(zhuǎn)</navigator><button @click="goDetail">跳轉(zhuǎn)之信息頁(yè)</button></view>
</template><script>export default {data() {return {imgArr:[]}},methods: {chooseImg(){uni.chooseImage({count:5,success:res=>{console.log(res)this.imgArr=res.tempFilePaths}})},previewImg(current){uni.previewImage({current,urls:this.imgArr,loop:true})},goDetail(){uni.navigateTo({url:'/pages/detail/detail'})}}}
</script><style></style>
運(yùn)行結(jié)果
總結(jié)
以上是生活随笔為你收集整理的前端学习(2368):编程式导航的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 硬件开发笔记(二):硬件开发基本流程,制
- 下一篇: 前端学习(2216):react元素渲染