feat: update vc-notification to 3.3.1
parent
d2ce2e50f0
commit
0593665d7c
|
@ -33,7 +33,10 @@ export default {
|
||||||
this.willDestroy = true; // beforeDestroy调用后依然会触发onMouseleave事件
|
this.willDestroy = true; // beforeDestroy调用后依然会触发onMouseleave事件
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close(e) {
|
||||||
|
if (e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
this.clearCloseTimer();
|
this.clearCloseTimer();
|
||||||
this.__emit('close');
|
this.__emit('close');
|
||||||
},
|
},
|
||||||
|
|
|
@ -92,6 +92,39 @@ function updatableFn() {
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let notification2 = null;
|
||||||
|
const clearPath = 'M793 242H366v-74c0-6.7-7.7-10.4-12.9' +
|
||||||
|
'-6.3l-142 112c-4.1 3.2-4.1 9.4 0 12.6l142 112c' +
|
||||||
|
'5.2 4.1 12.9 0.4 12.9-6.3v-74h415v470H175c-4.4' +
|
||||||
|
' 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-' +
|
||||||
|
'28.7 64-64V306c0-35.3-28.7-64-64-64z';
|
||||||
|
Notification.newInstance({
|
||||||
|
closeIcon: h => {
|
||||||
|
return (
|
||||||
|
<i>
|
||||||
|
<svg
|
||||||
|
viewBox="0 0 1024 1024"
|
||||||
|
width="1em"
|
||||||
|
height="1em"
|
||||||
|
fill="currentColor"
|
||||||
|
style={{ verticalAlign: '-.125em ' }}
|
||||||
|
>
|
||||||
|
<path d={clearPath} />
|
||||||
|
</svg>
|
||||||
|
</i>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}, (n) => {
|
||||||
|
notification2 = n;
|
||||||
|
});
|
||||||
|
function customCloseIconFn() {
|
||||||
|
notification2.notice({
|
||||||
|
content: 'It is using custom close icon...',
|
||||||
|
closable: true,
|
||||||
|
duration: 0,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
|
@ -101,6 +134,9 @@ export default {
|
||||||
<button onClick={closableFn}>closable</button>
|
<button onClick={closableFn}>closable</button>
|
||||||
<button onClick={manualClose}>controlled close</button>
|
<button onClick={manualClose}>controlled close</button>
|
||||||
<button onClick={updatableFn}>updatable</button>
|
<button onClick={updatableFn}>updatable</button>
|
||||||
|
<div>
|
||||||
|
<button onClick={customCloseIconFn}>custom close icon</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
// based on rc-notification 3.3.0
|
// based on rc-notification 3.3.1
|
||||||
import Notification from './Notification';
|
import Notification from './Notification';
|
||||||
export default Notification;
|
export default Notification;
|
||||||
|
|
Loading…
Reference in New Issue