# nw-vue-cli-example **Repository Path**: zqyadam/nw-vue-cli-example ## Basic Information - **Project Name**: nw-vue-cli-example - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: vue-2 - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-02-10 - **Last Updated**: 2024-02-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # nw-vue-cli-example * * * ## This project is outdated, use the new repo: Vue-CLI is an abstraction for WebPack, but the Vue community is now only supporting Vite going forward. The new repo has all of the features this repo had, except with a slightly newer tech stack. * https://github.com/nwutils/nw-vue3-boilerplate * * * [](https://travis-ci.org/nwutils/nw-vue-cli-example) * 1.x releases use: Vue 2 + NW.js latest + Vue-CLI 5 * 2.x releases use: Vue 3 + NW.js latest + Vue-CLI latest  **Comes with:** * NW.js 0.62.2 * Chrome 99 * Node 17.7.2 * Vue-CLI 5.0.4 * Vue 2.6.14 * Vue-DevTools (latest) * Babel * ESLint * Vue Linting * A11Y Linting * Jest Linting * Import Linting * Jest (100% test coverage) * Jest Serializer Vue (TJW) *Does this work for web or just desktop?* **Both**. This repo will build both for web and desktop and includes a simple `this.isDesktop` flag so you can add Desktop specific features that won't show on the web. This repo has 100% test coverage including tests for both web and desktop builds. You could even theoretically add NativeScript-Vue into the mix and build for native mobile as well (though that is not set up in this repo). *Why not include Vue-Router or Vuex?* Those are both very easily added from the Vue-CLI. There is also no custom styling libraries (Bulma, Bootstrap, etc), or meta-languages (Sass, TS, Pug, etc), or component libraries (Vuetify, Inkline, etc). This repo is meant to be the "go to" option for building **all** desktop apps using Vue. So it avoids pushing any particular choices on to you. With the exception of testing being set up for Jest, and Linting being set up to ensure minumum quality of this boilerplate repo itself. Both of which can be easily modified, ignored, or removed. If you want to load the app with a splash screen, check the `nw-splasher` branch. ## Documentation In all .vue components, you have access to `nw`, `global`, `process`, `require`, and the boolean `isDesktop`: ```js methods: { example: function () { if (this.isDesktop) { console.log('Your OS is ' + this.process.platform); console.log('Your AppData location is ' + this.nw.App.dataPath); // Sets a value on Node's global, meaning other windows have access to this data. this.global.cow = 'moo'; // The contents of the current directory console.log(this.require('fs').readdirSync('.')); } } } ``` Or even directly from the template (with some slight changes to work within the Vue context): ```html