提交 4b016c1d 编写于 作者: fxy060608's avatar fxy060608

build(deps): bump vite from 2.0.1 to 2.0.5

上级 532e580d
......@@ -66,7 +66,7 @@
"semver": "^7.3.4",
"ts-jest": "^26.4.4",
"typescript": "^4.1.3",
"vite": "^2.0.1",
"vite": "^2.0.5",
"vue": "3.0.5",
"yorkie": "^2.0.0"
}
......
// 暂不提供通知所有
// function broadcast (componentName, eventName, ...params) {
// this.$children.forEach(child => {
// const name = child.$options.name && child.$options.name.substr(1)
// if (~componentName.indexOf(name)) {
// child.$emit.apply(child, [eventName].concat(params))
// } else {
// broadcast.apply(child, [componentName, eventName].concat([params]))
// }
// })
// }
function broadcast(componentName, eventName, ...params) {
const children = this.$children
const len = children.length
for (let i = 0; i < len; i++) {
const child = children[i]
const name = child.$options.name && child.$options.name.substr(4)
if (~componentName.indexOf(name)) {
child.$emit.apply(child, [eventName].concat(params))
return false
} else {
if (
broadcast.apply(child, [componentName, eventName].concat([params])) ===
false
) {
return false
}
}
}
}
export default {
methods: {
$dispatch(componentName, eventName, ...params) {
if (typeof componentName === 'string') {
componentName = [componentName]
}
let parent = this.$parent || this.$root
let name = parent.$options.name && parent.$options.name.substr(4)
while (parent && (!name || !~componentName.indexOf(name))) {
parent = parent.$parent
if (parent) {
name = parent.$options.name && parent.$options.name.substr(4)
}
}
if (parent) {
parent.$emit.apply(parent, [eventName].concat(params))
}
},
$broadcast(componentName, eventName, ...params) {
if (typeof componentName === 'string') {
componentName = [componentName]
}
broadcast.apply(this, [componentName, eventName].concat(params))
}
}
}
// 暂不提供通知所有
// function broadcast (componentName, eventName, ...params) {
// this.$children.forEach(child => {
// const name = child.$options.name && child.$options.name.substr(1)
// if (~componentName.indexOf(name)) {
// child.$emit.apply(child, [eventName].concat(params))
// } else {
// broadcast.apply(child, [componentName, eventName].concat([params]))
// }
// })
// }
function broadcast(componentName, eventName, ...params) {
const children = this.$children
const len = children.length
for (let i = 0; i < len; i++) {
const child = children[i]
const name = child.$options.name && child.$options.name.substr(4)
if (~componentName.indexOf(name)) {
child.$emit.apply(child, [eventName].concat(params))
return false
} else {
if (
broadcast.apply(child, [componentName, eventName].concat([params])) ===
false
) {
return false
}
}
}
}
export default {
methods: {
$dispatch(componentName, eventName, ...params) {
console.log('$dispatch', componentName, eventName, params)
// if (typeof componentName === 'string') {
// componentName = [componentName]
// }
// let parent = this.$parent || this.$root
// let name = parent.$options.name && parent.$options.name.substr(4)
// while (parent && (!name || !~componentName.indexOf(name))) {
// parent = parent.$parent
// if (parent) {
// name = parent.$options.name && parent.$options.name.substr(4)
// }
// }
// if (parent) {
// parent.$emit.apply(parent, [eventName].concat(params))
// }
},
$broadcast(componentName, eventName, ...params) {
if (typeof componentName === 'string') {
componentName = [componentName]
}
broadcast.apply(this, [componentName, eventName].concat(params))
},
},
}
......@@ -2184,20 +2184,7 @@ function broadcast(componentName, eventName, ...params) {
var emitter = {
methods: {
$dispatch(componentName, eventName, ...params) {
if (typeof componentName === "string") {
componentName = [componentName];
}
let parent = this.$parent || this.$root;
let name = parent.$options.name && parent.$options.name.substr(4);
while (parent && (!name || !~componentName.indexOf(name))) {
parent = parent.$parent;
if (parent) {
name = parent.$options.name && parent.$options.name.substr(4);
}
}
if (parent) {
parent.$emit.apply(parent, [eventName].concat(params));
}
console.log("$dispatch", componentName, eventName, params);
},
$broadcast(componentName, eventName, ...params) {
if (typeof componentName === "string") {
......
......@@ -32,7 +32,7 @@
"peerDependencies": {
"@dcloudio/uni-cli-shared": "^3.0.0",
"@dcloudio/uni-shared": "^3.0.0",
"vite": "^2.0.1"
"vite": "^2.0.5"
},
"devDependencies": {
"@types/sass": "^1.16.0"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册