Having trouble with my navbar search form
<form action="" method="post" class="search">
<input type="text" name="" placeholder="поиск" class="input" v-model="allsearch"/>
<a href="#" @click='clicksearch()'>0</a>
</form>
The script I'm using:
<script>
export default {
name: 'Navbar',
data () {
return {
allsearch:''
}
},
methods: {
clicksearch(){
console.log(this.allsearch)
}
}
}
</script>
App.vue
:
<template>
<div id="app">
<Navbar />
<router-view/>
<Footer />
</div>
</template>
<style>
@import "assets/css/default.css";
@import "assets/css/header.css";
@import "assets/css/shortcodes.css";
@import "assets/css/core.css";
@import "assets/css/style.css";
</style>
<script>
import Navbar from "./components/Navbar";
import Footer from "./components/Footer"
export default {
components: {Navbar, Footer}
}
</script>
Router information:
import Vue from 'vue'
import VueRouter from 'vue-router'
import Posts from './views/Posts'
import Single from './views/Single';
import Smartigadget from './views/Smartigadget';
import Applesmartphone from './views/Applesmartphone';
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'posts',
component: Posts,
},
{
path: '/:id',
name: 'Single',
component: Single,
props:true
},
]
const router = new VueRouter({
mode: 'history',
routes
})
export default router
Error encounter: