data: () => ({
componentNames: [ 'comp1', 'comp2', 'comp3', 'comp4' ],
...
}),
computed: {
componentName() {
return [ 1, 2 ].includes(this.Q) && this.componentNames[this.B - 1];
},
},
<component :is="componentName"></component>
data: () => ({
components: [
{ name: '...', props: { ... } },
{ name: '...', props: { ... } },
...
],
...
}),
<component
v-if="component"
:is="component.name"
v-bind="component.props"
></component>
function plural(number, titles) {
cases = [2, 0, 1, 1, 1, 2];
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ];
}
var declension = ['год', 'года', 'лет'];
console.log('1 ', plural(1, declension));
console.log('2 ', plural(2, declension));
console.log('5 ', plural(5, declension));
console.log('7 ', plural(6, declension));
console.log('10 ', plural(10, declension));
console.log('20 ', plural(20, declension));
open $TMPDIR../C/com.apple.appstore
function isBot(&$botname = ''){
/* Эта функция будет проверять, является ли посетитель роботом поисковой системы */
$bots = array(
'rambler','googlebot','aport','yahoo','msnbot','turtle','mail.ru','omsktele',
'yetibot','picsearch','sape.bot','sape_context','gigabot','snapbot','alexa.com',
'megadownload.net','askpeter.info','igde.ru','ask.com','qwartabot','yanga.co.uk',
'scoutjet','similarpages','oozbot','shrinktheweb.com','aboutusbot','followsite.com',
'dataparksearch','google-sitemaps','appEngine-google','feedfetcher-google',
'liveinternet.ru','xml-sitemaps.com','agama','metadatalabs.com','h1.hrn.ru',
'googlealert.com','seo-rus.com','yaDirectBot','yandeG','yandex',
'yandexSomething','Copyscape.com','AdsBot-Google','domaintools.com',
'Nigma.ru','bing.com','dotnetdotcom'
);
foreach($bots as $bot)
if(stripos($_SERVER['HTTP_USER_AGENT'], $bot) !== false){
$botname = $bot;
return true;
}
return false;
}
if( isBot($bname) ) {
// Перебрасываем на Москву
}
const authGuard = (to, from, next) => {
if (store.getters.isAuthenticated) {
next();
return;
}
next('/login');
}
const router = new Router({
routes: [
{
path: '/',
name: 'Home',
component: Home,
},
{
path: '/account',
name: 'Account',
component: Account,
beforeEnter: authGuard,
},
});
Route::get('/{link}', function ($link) {
return Links::whereLink($link)->get(); # вернет объект
});
Route::get('/{link}', function ($link) {
return $link;
});
Route::get('/{link}', function ($link) {
$data = Links::where('link', '=', $link)->get(); # вернет объект
var_dump($data); # посмотреть вывод
return $data;
});
change your Find settings (Ctrl+F) to be case sensitive