new Vue({ el: '#app', mounted () { this.fetch() }, data: { sociedades: [], search:'' }, computed: { results () { if (!this.search) { return this.sociedades } else { return this.sociedades.filter(d => { let r = d.razon_social.toLocaleLowerCase().includes(this.search.toLocaleLowerCase()) d.avisos.filter (a => { }) return r }) } } }, methods: { fetch () { fetch("sociedades.json") .then( (res) => res.json()) .then(data => { this.sociedades = data }) } } })