update Notice

This commit is contained in:
Aresn 2017-06-01 10:52:27 +08:00
parent e8e1677b47
commit dd28e57f27

View file

@ -1,21 +1,15 @@
import Notification from './notification.vue'; import Notification from './notification.vue';
import Vue from 'vue'; import Vue from 'vue';
import { camelcaseToHyphen } from '../../../utils/assist';
Notification.newInstance = properties => { Notification.newInstance = properties => {
const _props = properties || {}; const _props = properties || {};
let props = '';
Object.keys(_props).forEach(prop => {
props += ' :' + camelcaseToHyphen(prop) + '=' + prop;
});
const Instance = new Vue({ const Instance = new Vue({
data: _props, data: _props,
render (h) { render (h) {
return h(Notification, { return h(Notification, {
props: _props props: _props
}) });
} }
}); });