Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
{"js":{"code":"const store = new Vuex.Store({\n state: {\n num: 0\n },\n \n mutations: {\n plus: (state) => {\n state.num += 1\n },\n \n minus: (state) => {\n state.num -= 1\n }\n }\n});\n\nconst app = new Vue({\n name: \"App\",\n \n template: `\n <div>\n <p>{{num}}</p>\n <button @click=\"plus\">+</button>\n <button @click=\"minus\">-</button>\n </div>\n `,\n \n computed: {[\"num\"]) },\n methods: {[\"plus\", \"minus\"]) }\n});\n\napp.$mount(\"#app\");\n","transformer":"js"},"css":{"code":"","transformer":"css"},"html":{"code":"<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width\">\n <title>Vuex-lite - demo</title>\n <script src=\"\"></script>\n <script src=\"\"></script>\n</head>\n<body>\n <div id=\"app\"></div>\n</body>\n</html>","transformer":"html"},"showPans":["html","js","console","output"],"activePan":"js"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment