在 Taro3 中使用 Vue
- 使用小程序组件事件需要将 bind 换成@或者 v-on
例如 小程序的点击事件 bindtap 换成@tap
- finally 无法使用
yarn add promise-prototype-finally
- solt 的使用
https://taro-docs.jd.com/taro/docs/hybrid#%E4%BD%BF%E7%94%A8-slot
- taro 3.0 + Vue 中 scoped 在 h5 下生效,在微信小程序中无效
// option Api
data() {
return {
res: [],
msg: "",
};
},
created() {
this.getRes();
},
methods: {
getRes: async function () {
this.res = await test();
},
},
setup() {
const res = ref([]);
const msg = ref("");
const getRes = async () => {
const result = await test();
res.value = result;
};
getRes();
return { res, msg };
},