{"id":16385287,"url":"https://github.com/hacke2/vue-append","last_synced_at":"2025-03-16T16:30:52.584Z","repository":{"id":46194093,"uuid":"90357459","full_name":"hacke2/vue-append","owner":"hacke2","description":"vue-append, like v-html directive, but it can call javascript function.","archived":false,"fork":false,"pushed_at":"2021-11-08T10:30:24.000Z","size":165,"stargazers_count":42,"open_issues_count":3,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T11:33:07.907Z","etag":null,"topics":["vue","vue-directive"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vue-append","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hacke2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-05T09:01:57.000Z","updated_at":"2024-05-10T02:34:55.000Z","dependencies_parsed_at":"2022-09-08T10:12:19.068Z","dependency_job_id":null,"html_url":"https://github.com/hacke2/vue-append","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacke2%2Fvue-append","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacke2%2Fvue-append/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacke2%2Fvue-append/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacke2%2Fvue-append/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hacke2","download_url":"https://codeload.github.com/hacke2/vue-append/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822283,"owners_count":20353499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["vue","vue-directive"],"created_at":"2024-10-11T04:14:09.182Z","updated_at":"2025-03-16T16:30:52.282Z","avatar_url":"https://github.com/hacke2.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-append\n\n\u003e vue-append, like v-html directive, but it can call javascript function\n\n## Install\n\n```\nnpm install vue-append --save\n# or\nyarn add vue-append\n```\n\n#### Es6 module\n\n- Available through npm as `vue-append`.\n\n``` js\n  import VueAppend from 'vue-append'\n  Vue.use(VueAppend)\n```\n\n#### CommonJS\n\n``` js\n  var VueAppend = require('vue-append')\n  Vue.use(VueAppend)\n```\n\n#### Direct include\n\n- You can also directly include it with a `\u003cscript\u003e` tag. It will automatically install itself, and will add a global `VueAppend`.\n\n## Event\n\n### appended\n\n- if html append , script downloaded and no throw error, it will fire `appended` event.\n\n### appenderr\n\n- if throw error when html appended, it will fire `appenderr` event.\n\n## Usage\n\n#### Using the `v-append` directive\n\ntemplate:\n\n``` html\n\u003cdiv id=\"app\"\u003e\n    \u003cdiv v-append=\"html\" @appended=\"appended\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n``` html\n\u003cdiv id=\"app\"\u003e\n    \u003cdiv v-append.sync=\"html\" @appended=\"appended\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\njs:\n\n```js\nimport Vue from 'vue/dist/vue.esm'\nimport VueAppend from 'vue-append'\n\n// use the plugin\nVue.use(VueAppend);\n\nconst html = `\n\u003cdiv id=\"test\"\u003e1\u003c/div\u003e\n\u003cscript\n  src=\"https://code.jquery.com/jquery-3.4.1.min.js\"\n  integrity=\"sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=\"\n  crossorigin=\"anonymous\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nvar i = 1;\nsetInterval(function() {\n    document.getElementById(\"test\").innerHTML = ++i;\n}, 1000);\n\u003c/script\u003e\n\n`;\n\nnew Vue({\n  el: '#app',\n  data: {\n    html: html\n  },\n  methods: {\n    appended() {\n      console.log('appended!');\n      // could use jQuery 😊\n      alert(window.jQuery);\n    }\n  }\n});\n```\n\nSee `/example` for a timer demo. To build it, run `npm install \u0026\u0026 npm run build`.\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhacke2%2Fvue-append","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhacke2%2Fvue-append","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhacke2%2Fvue-append/lists"}