Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #6 from shudin/master
Browse files Browse the repository at this point in the history
Fixed target component not updating when binding is empty
  • Loading branch information
metachris authored May 17, 2017
2 parents 71bf91f + 133106f commit 296ba76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ vueHighlightJS.install = function install(Vue) {
for (var i = 0; i < targets.length; i += 1) {
const target = targets[i];

if (binding.value) {
if (typeof binding.value === 'string') {
// if a value is directly assigned to the directive, use this
// instead of the element content.
target.textContent = binding.value;
Expand All @@ -27,7 +27,7 @@ vueHighlightJS.install = function install(Vue) {

for (var i = 0; i < targets.length; i += 1) {
const target = targets[i];
if (binding.value) {
if (typeof binding.value === 'string') {
target.textContent = binding.value;
hljs.highlightBlock(target);
}
Expand Down

0 comments on commit 296ba76

Please # to comment.