Skip to content

Instantly share code, notes, and snippets.

View duwaljyoti's full-sized avatar

Jyoti Duwal duwaljyoti

  • Kathmandu ,Nepal
  • 07:37 (UTC +05:45)
View GitHub Profile
<?php
// on hittig note on domain one gets redirected to the note.index.blade.php.
Route::get('/note', function() {
return view('note.index');
})->name('note');
user/routes.js
import Vue from 'vue';
import Vuex from "vuex";
import VueRouter from 'vue-router';
import routes from './routes';
import store from './store';
Vue.use(VueRouter);
Vue.use(Vuex);
lets assume we have a laptop..
name => fx400
id of attribute in bracket
attributes => color(1), RAM(2), touchable screen(3)
id of attribute value in bracket
attribute value
i have one product..
for eg.. apache..
apache has three attributes..
attributes => 1) color 2) brakes 3) ABS
value of attributes..
color => 1) red 2) white
brakes => 1) disc 2) drum
ABS => 1) Yes 2) No
<template>
<div class="note-form">
<div class="component-header">Create A new Note</div>
<form @submit.prevent="add">
<input v-model="title">
<button type="submit">Create</button>
</form>
</div>
</template>
<template>
<div>
<ul class="list-group center">
<div class="component-header">Notes({{ notesLength }})</div>
<li v-for="(note, index) in notes" class="list-group-item" v-if="notesLength">
<div class="row">
<div class="col-sm-7">
<span v-if="currentEditingId !== note.id">{{ note.title }}</span>
<input type="text" v-if="currentEditingId === note.id && editing" :placeholder="note.title"
v-model="editedTitle">
import Vue from 'vue';
import VueRouter from 'vue-router';
import NoteApp from './components/NoteApp.vue';
import routes from './routes';
import notesStore from './store/notesStore';
Vue.use(VueRouter);
const router = new VueRouter({
routes
import CreateNote from './components/CreateNote.vue'
import List from './components/List.vue'
import FavouriteList from './components/FavouriteList.vue'
const routes = [
{ path: '/', component: List },
{ path: '/create', component: CreateNote },
{ path: '/list', component: List },
{ path: '/favourite-list', component: FavouriteList },
{ path: '*', redirect: '/list' },
import Vue from 'vue';
import Vuex from 'vuex';
import axios from 'axios';
import notes from '../api';
Vue.use(Vuex);
const notesStore = new Vuex.Store({
state: {
notes: [],
const notes = '/api/notes';
export default notes;