event.preventDefault();
. задал аттрибут test и его видно
const setParams = (url, params) =>
Object.entries(params).reduce((acc, [ k, v ]) => {
const reg = RegExp(`${k}-\\d+(/?)`);
return reg.test(acc)
? acc.replace(reg, v !== null ? `${k}-${v}$1` : '')
: v !== null
? `${acc}${acc[acc.length - 1] === '/' ? '' : '/'}${k}-${v}`
: acc;
}, url);
const url = 'http://sitename.net/somedirectory/14545/count-1145/specific-345';
const params = [
{ count: 666 },
{ count: 666, specific: 187 },
{ count: null, specific: null },
{ count: null, specific: 187, xxx: 69 },
{ specific: 0 },
];
const newUrls = params.map(n => setParams(url, n));
data: () => ({
opened: null,
dropdowns: [
{ selected: [], items: [ ... ] },
{ selected: [], items: [ ... ] },
...
],
}),
<div
v-for="n in dropdowns"
class="dropdown-checkbox"
>
<label @click="opened = opened === n ? null : n">
SELECT
</label>
<ul :class="{ opened: opened === n }">
<li v-for="item in n.items">
<label>
<input type="checkbox" :value="item" v-model="n.selected">
{{ item }}
</label>
</li>
</ul>
</div>
не поступают данные
props: {
sectionData: Object,
},
{{section.title}}
{{ sectionData.title }}
props: { isActive: Boolean },
data: () => ({
isActive: false,
}),
v-else="isActive==true"