Created
May 22, 2021 07:47
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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