All Posts

  • vue directives

    Different Vue Directives The different Vue directives we use in this tutorial are listed below. Directive Details v-bind Connects an attribute in an HTML tag to a data variable inside the Vue instance. v-if Creates HTML tags depending on a condition. Directives v-else-if and v-else are used together with the v-if directive. v-show Specifies if…

  • Addin Vue.js to project

    Example of VueJs

  • python data types

    Python has the following data types built-in by default, in these categories: Text Type: str Numeric Types: int, float, complex Sequence Types: list, tuple, range Mapping Type: dict Set Types: set, frozenset Boolean Type: bool Binary Types: bytes, bytearray, memoryview None Type: NoneType

  • python – unpack a collection

    If you have a collection of values in a list, tuple etc. Python allows you to extract the values into variables. This is called unpacking. This is also called de-structuring in javascript. example

  • Python Variables – Assign Multiple Values

    Python allows you to assign values to multiple variables in one line:

  • python type casting

    though not necessary to declare the type of variable, but it can be casted to a specific type. example below

  • python comment

    python comment starts with # Since Python will ignore string literals that are not assigned to a variable, you can add a multiline string (triple quotes) in your code, and place your comment inside it:

  • Python Indentation

    Where in other programming languages the indentation in code is for readability only, the indentation in Python is very important. Python uses indentation to indicate a block of code. The number of spaces is up to you as a programmer, the most common use is four, but it has to be at least one. example

  • Showing loader in nextJs

    you need to wrap the children in root layout with a built in Suspense component. Example: Another way is to create a loading component in project root with the follow code also to use loading spinner you need to have tailwind and daisy-ui installed to install daisy ui use below command

  • Adding navbar to NextJs project

    Add a new file NavBar.tsx next to layout.tsx that is in the root of the project and the add the below code. Then layout.tsx to be modified like below

  • Admin Layout

    create an admin folder in app folder and then create a file named layout.tsx or layout.jsx. and create a component for layout like

  • react nextJs css module or scoped css

    with convention you should name module.css like productcard.module.css and them import that css as and then you can use this css like Note: donot use css classes with name with hypen – as css classes are properties of javascript object style, which cannot have hypen. assuming that you have a class as card in ProductCard.module.css.