I have simply followed Laravel documentation for setting up Vue.js
When the build is ready, add app.js from the public folder to your blade.php page’s footer
If you are getting an error saying the components not found, it means your script is executing before the document is ready
Make sure you have added app.js script at the end of the page
Adding new component (similar to ‘example’ component given with Laravel):
Components are one of the most powerful features of Vue. They help you extend basic HTML elements to encapsulate reusable code. At a high level, components are custom elements that Vue’s compiler attaches behavior to. In some cases, they may also appear as a native HTML element extended with the special is attribute.
Create a new component in resources/components called Greeting.vue
Add your bootstrap element inside template element
Create an instance of ‘greeting’ component in app.js
If your machine already has Android SDK installed then you’ll need to manually install NativeScript following the steps on the quick-setup page
Windows intaller needs – Java Development Kit, Nodes.js, Android SDK pre-installed
Complete the installation by following all the instructions above
tns command from CLI
tns create HelloWorld –template nativescript-template-tutorial to create Helloworld app
Go to the app folder – cd HelloWorld
Running the app:
tns run android:
You must have at least one AVD (Android Virtual Device) configured on your development machine for this command to run your app up on an Android emulator. If you don’t have one installed currently go ahead and set one up now.
creating new virtual android emulator:
Open android sdk manager from start menu – You have installed as part of the pre-requiresites for NativeScript
Check all the system images are installed for future use or else click the install packages button at bottom right corner.
exports.loaded page binding is important for any parameter passing to work
login works from now
As a best practice, testing for a platform with an if check is the way to go when you have a small number of platform-specific changes to make. If, on the contrary, you have big, entirely different chunks of code for iOS and Android, you might want to go with platform-specific code-behind files—e.g. login.ios.js and login.android.js.
1)Download node.js(.msi file)
2)Install node.js from node js website. NPM is installed as part of the installation.
3)Run node.js application / run git bash/ run command line
4)Check node command working on all of the above
5)If node command doesn’t work on git bash, set the path using the following
a.export PATH=$PATH:”C:\Program Files\nodejs”
b.unix style path
6)If node command doesn’t work on command line, set the path using the following
a.SET PATH=C:/Program Files/nodejs;%PATH%
8)With Node you have to write the webserver unlike PHP where you just install and use, here at node you have to write the webserver.
Testing Node Installation:
Open command prompt and type in “node -v” to see the node version
alternatively you can open node.js and type in “process.version”
If you have opened command prompt and typed in ‘node’ and pressed Enter then you need to type in “process.version” to know the version of node
Test NPM installation:
Make sure ‘%AppData%/npm’ is added to the path variable. Add it if it is not already added
create a node-test folder
Go to the folder on command prompt
Type in command ‘npm init’ which creates package.json file for your project
If the command doesn’t work, it means you haven’t set the path correct. Check point 1 and set your path variable right.
Install a sample package by typing the command “npm install lodash”