Answer the question
In order to leave comments, you need to log in
How to set an after sprite to a pseudo-element?
Preparing my sprites with compass. Everything is working. There was a task to display "daw" in a checkbox.
The checkbox is made as follows. The input itself is hidden. The label is displayed and a pseudo-element is created in css - a square, which is pressed to the right to the edge of the form. Now we need to display the checkbox by adding a class to the label. This can be done using a separate picture, but I would like to pull it out of the sprite. There was an idea to pull it out manually by setting the indents, but I'm afraid the desired image will move during the development process, so I abandoned this idea.
Answer the question
In order to leave comments, you need to log in
NogerbekNurzhan , your geoObject method is too smart. We need decomposition. A separate method creates the map, a separate method manipulates the rendered objects, and another can clear the objects. example: createMap()
, setObjects(dateStart, dateEnd)
, deleteObjects()
Write a separate handler for the event @clicked=onChangeDate
in which you call the re-creation of objects on the existing map
onChangeDate(dateStart, dateEnd) {
this.deleteObjects();
this.setObjects(dateStart, dateEnd);
}
<MyComp>
<Navbar @clicked="onChangeDate"/>
<YandexMap
:date-start="dateStart"
:date-end="dateEnd"
/>
<MyComp>
<script>
data: function(){
return {
dateStart: null,
dateEnd: null,
}
}
methods: {
onchangeDate(d1, d2){
this.dateStart = d1;
this.dateEnd = d2;
}
}
</script>
In the child component on click this.$emit('event-name', data). In the parent template on the child component: @event-name="handler". Just like Alex gave an example.
In general, this is an anti-pattern, so even the view docs say that the data must be stored in the application state, at least I just use a separate view instance
Incultivate the mixin into the label pseudo-element (file with checkbox ok.png)
@import 'compass'
@import "compass/utilities/sprites"
$icons-layout:smart
@import "grey/icons/*.png"
@include all-icons-sprites
...
label.boolean.checked:after
@include icons-sprite(ok)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question