Skip to content

Commit

Permalink
fix(vue3): 使用 setup 语法编写 vue3 内置组件,fix #11393 (#11440)
Browse files Browse the repository at this point in the history
* fix(vue3): 使用 setup 语法编写 vue3 内置组件,fix #11393

* fix: ci
  • Loading branch information
Chen-jj authored Mar 26, 2022
1 parent 5a9707a commit 604f54c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,8 @@ require(\\"./taro\\");
component.mixins = [ inject ];
}
var ProviderComponent = {
provide: {
id: id
setup: function setup() {
Object(vue[\\"provide\\"])(\\"id\\", id);
},
render: function render() {
return this.$slots.default();
Expand Down
5 changes: 4 additions & 1 deletion packages/taro-plugin-vue3/src/runtime/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Current,
injectPageInstance
} from '@tarojs/runtime'
import { provide } from 'vue'
import { setDefaultDescriptor, setRouterParams } from './utils'

import type {
Expand Down Expand Up @@ -91,7 +92,9 @@ function createVue3Page (h: typeof createElement, id: string) {
}

const ProviderComponent = {
provide: { id },
setup () {
provide('id', id)
},
render () {
return this.$slots.default()
}
Expand Down

0 comments on commit 604f54c

Please sign in to comment.