Mix -> Vite
- install dependencies
vitelaravel-vite-pluginvite-plugin-vue2(for vue2.6)@vitejs/plugin-vue2(for vue2.7) or@vitejs/plugin-vue(for vue3)
for vue 2.7 https://github.com/vuejs/vue/blob/main/CHANGELOG.md#270-2022-07-01
| const Example = { | |
| data() { | |
| return { | |
| users: [ | |
| { | |
| id: 1, name: 'Aslam', permissions: ['view'] | |
| }, | |
| { | |
| id: 2, name: 'Jonwik', permissions: [] | |
| } |
| <?php | |
| use Illuminate\Support\Str; | |
| function generateReferralCode($str) { | |
| // get random number min & max 4 digit | |
| $randomNumber = rand(1000, 9999); | |
| // get the first 4 character and trim whitespace | |
| $strName = trim(substr($str, 0, 4)); | |
| // get str length |
| // Check whether quill content is empty | |
| function isQuillEmpty(quill) { | |
| if ((quill.getContents()['ops'] || []).length !== 1) { | |
| return false | |
| } | |
| return quill.getText().trim().length === 0 | |
| } | |
| // Delta to HTML |
Mix -> Vite
vitelaravel-vite-pluginvite-plugin-vue2 (for vue2.6) @vitejs/plugin-vue2 (for vue2.7) or @vitejs/plugin-vue (for vue3)for vue 2.7 https://github.com/vuejs/vue/blob/main/CHANGELOG.md#270-2022-07-01
This follow the lunar structure code.
First create folder call Pages and Components inside App\Http\Livewire it will become something like this.
App\Http\Livewire\Components
App\Http\Livewire\Pages
Moving on. we will create new Page call Foo
FooIndex inside Pageskode ini harus di enchance. agar tidak terjadi case seperti ini lagi pada margin import tambahan
grade_mapping = {
"Mega Store": "mega",
"Basic Store": "basic",
"Super Store": "super",
}api response
{
"data": [
...
],
"links": {
"first": "https://example.com/pagination?page=1",
"last": "https://example.com/pagination?page=10",| const [currentPosition, setCurrentPosition] = useState(0) | |
| const [isScrollingToBottom, setIsScrollingToBottom] = useState(false) | |
| useEffect(() => { | |
| const handleScroll = () => { | |
| const { scrollTop } = document.documentElement | |
| const isScrollingDown = scrollTop > currentPosition | |
| setIsScrollingToBottom(isScrollingDown) | |
| setCurrentPosition(scrollTop) |
| const [isTop, setIsTop] = useState(true) | |
| useEffect(() => { | |
| const handleScroll = () => { | |
| setIsTop(window.scrollY < 100) | |
| } | |
| window.addEventListener('scroll', handleScroll) | |
| return () => { |