diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-30 21:08:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-30 21:08:57 +0300 |
commit | d8121cb00b8bbd281d7362902590b110639bdeba (patch) | |
tree | 0a0f71b247b232773a46732d9f74aa3cfed0ef1a /app/assets/javascripts/vue_alerts.js | |
parent | 536aa3a1f4b96abc4ca34489bf2cbe503afcded7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_alerts.js')
-rw-r--r-- | app/assets/javascripts/vue_alerts.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_alerts.js b/app/assets/javascripts/vue_alerts.js new file mode 100644 index 00000000000..6550eb31491 --- /dev/null +++ b/app/assets/javascripts/vue_alerts.js @@ -0,0 +1,22 @@ +import Vue from 'vue'; +import { parseBoolean } from '~/lib/utils/common_utils'; +import DismissibleAlert from '~/vue_shared/components/dismissible_alert.vue'; + +const mountVueAlert = el => { + const props = { + html: el.innerHTML, + }; + const attrs = { + ...el.dataset, + dismissible: parseBoolean(el.dataset.dismissible), + }; + + return new Vue({ + el, + render(h) { + return h(DismissibleAlert, { props, attrs }); + }, + }); +}; + +export default () => [...document.querySelectorAll('.js-vue-alert')].map(mountVueAlert); |