Skip to content

Commit

Permalink
fix(fixed): 增加组件triggerEvent事件
Browse files Browse the repository at this point in the history
  • Loading branch information
xucz committed Dec 17, 2018
1 parent 87e1a39 commit 44ae46a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/duv-template-compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "duv-template-compiler",
"version": "0.1.2",
"version": "0.1.4",
"description": "duv template compiler for Duv",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/duvjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "duvjs",
"version": "0.1.2",
"version": "0.1.4",
"description": "Duv Runtime",
"main": "index.js",
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion src/platforms/duv/runtime/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function dataProxy (v, d) {
function proxy (vSelf, dSelf, key) {
let value = vSelf[key]
sharedPropertyDefinition.get = function proxyGetter () {
if(key === 'globalData') {
if(key === 'globalData' || key === 'triggerEvent') {
return dSelf[key]
} else if (dataKeys.includes(key)) {
return dSelf.data[key]
Expand Down Expand Up @@ -184,6 +184,7 @@ export function mountDuv (duvType, next) {
this.globalData = app.globalData
duv.page = this
duv.self = this
vself.triggerEvent = function () {}
dataProxy(vself, this)
},
attached () {
Expand Down

0 comments on commit 44ae46a

Please sign in to comment.