fix id errors

This commit is contained in:
jiahao
2020-05-15 13:22:05 +08:00
parent 054854480a
commit 65f5b529bf
26 changed files with 208 additions and 78 deletions

View File

@ -144,12 +144,17 @@ export default {
}
},
data () {
const timestamp = Date.now()
let d = new Date().getTime();
const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (d + Math.random()*16)%16 | 0;
d = Math.floor(d/16);
return (c=='x' ? r : (r&0x7|0x8)).toString(16);
});
return {
ref: 'border-box-9',
gradientId: `border-box-9-gradient-${timestamp}`,
maskId: `border-box-9-mask-${timestamp}`,
gradientId: `border-box-9-gradient-${uuid}`,
maskId: `border-box-9-mask-${uuid}`,
defaultColor: ['#11eefd', '#0078d2'],