提交 62fb0d52 编写于 作者: fxy060608's avatar fxy060608

fix(v3): add $page (view)

上级 10064323
......@@ -9012,7 +9012,8 @@ var serviceContext = (function () {
const handleVdData = {
[UI_EVENT]: function onUIEvent (vdBatchEvent, vd) {
vdBatchEvent.forEach(([cid, nid, event]) => {
vdBatchEvent.forEach(([cid, nid, event]) => {
nid = String(nid);
console.log(`[EVENT]`, cid, nid, event);
event.preventDefault = noop;
event.stopPropagation = noop;
......
......@@ -13108,6 +13108,13 @@ var data = __webpack_require__(12);
// CONCATENATED MODULE: ./src/platforms/app-plus/view/framework/plugins/event.js
function initEvent(Vue) {
// 部分组件内部使用了$page
Object.defineProperty(Vue.prototype, '$page', {
get: function get() {
return getCurrentPages()[0].$page;
}
});
Vue.prototype.$handleViewEvent = function ($vueEvent, options) {
var $event = this.$handleEvent($vueEvent);
var cid = this._$id; // 当自定义组件根节点触发事件时,nid 始终为 0
......
......@@ -17,7 +17,8 @@ import {
const handleVdData = {
[UI_EVENT]: function onUIEvent (vdBatchEvent, vd) {
vdBatchEvent.forEach(([cid, nid, event]) => {
vdBatchEvent.forEach(([cid, nid, event]) => {
nid = String(nid)
console.log(`[EVENT]`, cid, nid, event)
event.preventDefault = noop
event.stopPropagation = noop
......
......@@ -3,6 +3,13 @@ import {
} from './data'
export function initEvent (Vue) {
// 部分组件内部使用了$page
Object.defineProperty(Vue.prototype, '$page', {
get () {
return getCurrentPages()[0].$page
}
})
Vue.prototype.$handleViewEvent = function ($vueEvent, options) {
const $event = this.$handleEvent($vueEvent)
const cid = this._$id
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册