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

@ -92,12 +92,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-8',
path: `border-box-8-path-${timestamp}`,
gradient: `border-box-8-gradient-${timestamp}`,
mask: `border-box-8-mask-${timestamp}`,
path: `border-box-8-path-${uuid}`,
gradient: `border-box-8-gradient-${uuid}`,
mask: `border-box-8-mask-${uuid}`,
defaultColor: ['#235fa7', '#4fd2dd'],