const routes = [
{ path: '/foo', component: Foo },
{ path: '/bar', component: Bar, isDevOnly: true },
{ path: '*', component: Baz },
]
const router = new VueRouter({
routes: routes.filter(r => DEVELOPMENT || !r.isDevOnly)
})
DEVELOPMENT
из переменной окружения с помощью DefinePluginconst webpack = require('webpack');
module.exports = {
// ...
plugins: [
new webpack.DefinePlugin({
DEVELOPMENT: JSON.stringify(process.env.mode === 'development'),
}
]
Есть ассоциативный многомерный массив
var data = {
sedan: {
'eject' : {
'13' : 50,
'14' : 50,
'15' : 50
},
'installation' : {
'13' : 25,
'14' : 40,
'15' : 50
},
'balancing' : {
'13' : 50,
'14' : 60,
'15' : 80
}
},
crossover: {
'eject' : {
'13' : 50,
'14' : 60,
'15' : 60
},
'installation' : {
'13' : 50,
'14' : 60,
'15' : 60
},
'balancing' : {
'13' : 444,
'14' : 555,
'15' : 666
}
},
};
data[x].balancing
$chelyabinsk_id = 100;
$сities = City::where('people', '>', 100000)->orderBy('people')->get();
$position = $сities->where('id', $chelyabinsk_id)->keys()->first());
$categories = Category::select(DB::raw('categories.*, count(*) as `aggregate`'))
->join('pictures', 'categories.id', '=', 'pictures.category_id')
->groupBy('category_id')
->orderBy('aggregate', 'desc')
->paginate(10);