const category = [
{
id: 1,
name: "Фрукты",
},
{
id: 2,
name: "Овощи",
},
{
id: 3,
name: "Напитки",
},
];
const subcategory = [
{ id: 1, name: "Апельсины", categoryId: 1 },
{ id: 2, name: "Бананы", categoryId: 1 },
{ id: 3, name: "Картошка", categoryId: 2 },
{ id: 4, name: "Кока-кола", categoryId: 2 },
];
//one-to-many
const state = [
{
id: 1,
category: "Фрукты",
subcategory: [
{ id: 1, name: "Апельсины" },
{ id: 2, name: "Бананы" },
],
},
{
id: 2,
category: "Овощи",
subcategory: [{ id: 1, name: "Картошка" }],
},
{
id: 3,
category: "Напитки",
subcategory: [{ id: 1, name: "Кока-кола" }],
},
];
a = 1
even = a % 2 == 0
odd = a % 2 != 0
if even:
print('even')
if odd:
print('odd')
def isEven(value):
even = value % 2 == 0
odd = value % 2 != 0
if even:
print('even')
elif odd:
print('odd')
isEven(2)
def isEven(value):
even = value % 2 == 0
print(even if True else False)
isEven(2)
.parent{
position: relative;
}
.child{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
const mix = require('laravel-mix');
mix.js('resources/js/app.js', 'public/js')
.postCss('resources/css/app.css', 'public/css');
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"@vue/compiler-sfc": "^3.0.7",
"axios": "^0.21",
"bootstrap": "^4.6.0",
"jquery": "^3.6.0",
"laravel-mix": "^6.0.12",
"lodash": "^4.17.21",
"popper.js": "^1.16.1",
"postcss": "^8.2.8",
"resolve-url-loader": "^3.1.2",
"sass": "^1.32.8",
"sass-loader": "^10.1.1",
"vue": "^3.0.7",
"vue-loader": "^16.1.0"
}
}
npm install && npm run dev
D:\install\openserver\domains\apps.local>npm install && npm run dev
up to date, audited 1331 packages in 4s
98 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
> dev
> npm run development
> development
> mix
99% done plugins BuildOutputPlugin
Laravel Mix v6.0.13
✔ Compiled Successfully in 9383ms
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─────────┐
│ File │ Size │
├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────┤
│ /js/app.js │ 429 KiB │
│ css/app.css │ 1 bytes │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴─────────┘
√ Mix
Compiled successfully in 9.67s
webpack compiled successfully