Skip to content

Commit

Permalink
fix: fix v-route directive using router plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Masquerade-Circus committed Mar 12, 2022
1 parent 0d010f0 commit 25b817d
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 61 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
### [6.0.3](https://github.com/Masquerade-Circus/valyrian.js/compare/6.0.2...6.0.3) (2022-03-12)


### Build System

* remove preinstall script ([213ca2b](https://github.com/Masquerade-Circus/valyrian.js/commit/213ca2b72f37e4c7eeae884393e723f4af469e96))
* remove preinstall script ([213ca2b](https://github.com/Masquerade-Circus/valyrian.js/commit/213ca2b72f37e4c7eeae884393e723f4af469e96))

### [6.0.2](https://github.com/Masquerade-Circus/valyrian.js/compare/6.0.1...6.0.2) (2022-03-12)

Expand Down
26 changes: 15 additions & 11 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,22 @@ function createDomElement(tag, isSVG = false) {
return isSVG ? document.createElementNS("http://www.w3.org/2000/svg", tag) : document.createElement(tag);
}
function domToVnode(dom) {
let vnode = v(dom.tagName.toLowerCase(), {}, ...Array.from(dom.childNodes).filter((child) => child.nodeType === 1 || child.nodeType === 3).map((child) => {
if (child.nodeType === 1) {
return domToVnode(child);
if (dom.nodeType === 1 || dom.nodeType === 3) {
let vnode = v(dom.tagName.toLowerCase(), {}, ...Array.from(dom.childNodes).filter((child) => child.nodeType === 1 || child.nodeType === 3).map((child) => {
if (child.nodeType === 1) {
return domToVnode(child);
}
let text = new Vnode(TextString, {}, []);
text.nodeValue = String(child.nodeValue);
text.dom = child;
return text;
}));
if (dom.nodeType === 1) {
[].forEach.call(dom.attributes, (prop) => vnode.props[prop.nodeName] = prop.nodeValue);
}
let text = new Vnode(TextString, {}, []);
text.nodeValue = String(child.nodeValue);
text.dom = child;
return text;
}));
[].forEach.call(dom.attributes, (prop) => vnode.props[prop.nodeName] = prop.nodeValue);
vnode.dom = dom;
return vnode;
vnode.dom = dom;
return vnode;
}
}
var trust = (htmlString) => {
let div = createDomElement("div");
Expand Down
26 changes: 15 additions & 11 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,22 @@ function createDomElement(tag, isSVG = false) {
return isSVG ? document.createElementNS("http://www.w3.org/2000/svg", tag) : document.createElement(tag);
}
function domToVnode(dom) {
let vnode = v(dom.tagName.toLowerCase(), {}, ...Array.from(dom.childNodes).filter((child) => child.nodeType === 1 || child.nodeType === 3).map((child) => {
if (child.nodeType === 1) {
return domToVnode(child);
if (dom.nodeType === 1 || dom.nodeType === 3) {
let vnode = v(dom.tagName.toLowerCase(), {}, ...Array.from(dom.childNodes).filter((child) => child.nodeType === 1 || child.nodeType === 3).map((child) => {
if (child.nodeType === 1) {
return domToVnode(child);
}
let text = new Vnode(TextString, {}, []);
text.nodeValue = String(child.nodeValue);
text.dom = child;
return text;
}));
if (dom.nodeType === 1) {
[].forEach.call(dom.attributes, (prop) => vnode.props[prop.nodeName] = prop.nodeValue);
}
let text = new Vnode(TextString, {}, []);
text.nodeValue = String(child.nodeValue);
text.dom = child;
return text;
}));
[].forEach.call(dom.attributes, (prop) => vnode.props[prop.nodeName] = prop.nodeValue);
vnode.dom = dom;
return vnode;
vnode.dom = dom;
return vnode;
}
}
var trust = (htmlString) => {
let div = createDomElement("div");
Expand Down
2 changes: 1 addition & 1 deletion dist/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 25b817d

Please sign in to comment.