Skip to content

Instantly share code, notes, and snippets.

@PragatiVerma18
Created May 22, 2021 07:47
Show Gist options
  • Select an option

  • Save PragatiVerma18/c6e5beca1406c9e6015eb6ffbeab36b9 to your computer and use it in GitHub Desktop.

Select an option

Save PragatiVerma18/c6e5beca1406c9e6015eb6ffbeab36b9 to your computer and use it in GitHub Desktop.
The files required for building your first Adobe Photoshop and XD Plugin using VueJS - main.js contains code for the dialog and the modal
const styles = require("./styles.css");
const Vue = require("vue").default;
const hello = require("./hello.vue").default
const { Text, Color } = require("scenegraph");
let dialog;
function getDialog() {
if (dialog == null) {
document.body.innerHTML = `<dialog><div id="container"></div></dialog>`
dialog = document.querySelector("dialog");
var app4 = new Vue({
el: "#container",
components: { hello },
render(h) {
return h(hello, { props: { dialog } })
}
})
}
return dialog
}
module.exports = {
commands: {
menuCommand: function () {
getDialog().showModal();
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment