No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    UI extension with Single-File Component (SFC)

    Help
    2
    4
    498
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Marton last edited by

      Hi,

      I’m trying to create UI components extension based on the official UI kit (quasar create my-ext --kit ui). As I see, the render function was used to define a template.

      I prefer to use a Single-File Component file (comp.vue), but when I try to import this, I get a syntax error because I didn’t define the template compiler. It’s easy in the webpack world, but I can’t see any webpack components.

      So How can I use the vue file in the official UI extension template?

      Thanks in advance!

      1 Reply Last reply Reply Quote 0
      • Hawkeye64
        Hawkeye64 last edited by Hawkeye64

        @Marton You can look at this PR to add it. It’s been around for a while, so don’t think it will go in. https://github.com/quasarframework/quasar-starter-kit-ui/pull/19
        As for SFC vs Render functions, it took me a while to get used to them, but I would never go back. Components should be render functions and whatever consumes them should be SFC. There are things you can do in a render function that just can’t be done in a template without looking horrid and unreadable. Remember, HTML is not really a programming language. It’s a layout template. It should not be treated as a programming language.

        1 Reply Last reply Reply Quote 1
        • M
          Marton last edited by

          Hi @Hawkeye64, Thank you for your fast reply. That’s what I was looking for.

          1 Reply Last reply Reply Quote 0
          • Hawkeye64
            Hawkeye64 last edited by Hawkeye64

            @Marton Also, regarding render functions, you can debug them much easier than compiled template.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post