Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- searchContent = new Vue({
- el: "#searchContent",
- data: {
- vector: {}
- }
- });
- categories = new Vue({
- el: '#categories',
- data: {
- category: 0,
- subcategory: 0,
- content: false
- },
- watch: {
- subcategory: function(e) {
- this.prefetch();
- },
- category: function(e) {
- this.prefetch();
- },
- },
- methods: {
- prefetch: function() {
- var filter = {};
- filter['category'] = this.category;
- filter['subcategory'] = this.subcategory;
- if (this.content !== false)
- this.content.abort()
- this.content = $.ajax({
- 'url': 'filter/',
- data: filter,
- dataType: "JSON",
- type: "POST",
- success: function(e) {
- window.searchContent.vector = e.data;
- console.log(e);
- }
- })
- }
- }
- })
- </script>
- {"status": true, "data": []}
- <div id="searchContent" >
- <div v-for="row in vector" >{{row.bussinessName}}
- </div>
- <div>
Add Comment
Please, Sign In to add comment