/common/mixinx/ui.js
export const commonMethods = {
methods:{
goToPage(url){
uni.navigateTo({
url:url
})
}
}
}
/pages/home/home.vue
.......
<view id="test" @click="gotoPage('/pages/another/page')"></view>
........
<script>
export default {
mixins:[
valueGetters,
layouts,
commonMethods
]
.........
}
</script>
r***@126.com (作者)
谢谢回复,我待会儿试试。
2023-06-26 19:07