forked from shibao/cannery
mix format
This commit is contained in:
@ -2,9 +2,9 @@
|
||||
// update. https://github.com/phoenixframework/phoenix_live_view/issues/1011
|
||||
|
||||
export default {
|
||||
attrs() {
|
||||
const attrs = this.el.getAttribute('data-attrs');
|
||||
if (attrs) { return attrs.split(', '); } else { return []; }
|
||||
attrs () {
|
||||
const attrs = this.el.getAttribute('data-attrs')
|
||||
if (attrs) { return attrs.split(', ') } else { return [] }
|
||||
},
|
||||
beforeUpdate () { this.prevAttrs = this.attrs().map(name => [name, this.el.getAttribute(name)]) },
|
||||
updated () { this.prevAttrs.forEach(([name, val]) => this.el.setAttribute(name, val)) }
|
||||
|
Reference in New Issue
Block a user