1

i use framework7-vue + vuejs. Components, like chip, have simple syntax:

<f7-chip text="Example Chip"></f7-chip>

and generate simple html:

<div data-v-aa85b83a="" class="chip">
    <div class="chip-label">Example Chip</div>
</div>

element .chip has data-v attribute, why .chip-label doesnt? I need set style over chip-label, i know about /deep/ styling, but its shame. can i set data-v attribute to childrent elements dynamical components?

5
  • Please explain why you assume chip-label should have data-v attributes? Also why do you need that attribute in particular? Are you trying to do querySelector or similar against those elements? Commented Apr 20, 2019 at 0:00
  • sorry ) i need use scoped style for children elements, but they have not data-v attribute. Commented Apr 20, 2019 at 0:02
  • i know about deep selectors, but its shame ;) Commented Apr 20, 2019 at 0:05
  • It’s fine. Please add the scoped CSS you are tying to add to those elements and the issues you are experiencing please as well as what you are trying to achieve. Commented Apr 20, 2019 at 0:05
  • i have scss: .chip{ margin:0 5px 10px 0; /deep/ .chip-label{ margin-top:-2px; } } i need scss: .chip{ margin:0 5px 10px 0; .chip-label{ margin-top:-2px; } } Commented Apr 20, 2019 at 0:35

1 Answer 1

2

This is because you are either using <style> tags in your component (scoped styles) or you are viewing elements while running hot reload. This is more likely because of scoped styles, though.

Sign up to request clarification or add additional context in comments.

4 Comments

yes, i need scoped style, i know about /deep/ styles, but why dynamical components not set data-v attribute to children elements?
Because they don't need them. Those data-v-* attributes are only used to set styling. Thats how scoped styles work - without them the scoped styling's wouldn't work.
Nope. Not unless you want to give them style.
ah, i was wondering why my nested html tags did not contain data-v-xxx attribute. Thank you @MattOestreich

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.