前端学习(2367):两种方式导航跳转和传参
生活随笔
收集整理的這篇文章主要介紹了
前端学习(2367):两种方式导航跳转和传参
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
<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">跳轉</navigator><navigator url="../detail/detail" open-type="redirect">跳轉</navigator></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})}}}
</script><style></style>
運行結果
總結
以上是生活随笔為你收集整理的前端学习(2367):两种方式导航跳转和传参的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 前端学习(2131):作用域插槽的使用
- 下一篇: 前端学习(2149):webpack之E