Daily work Flashcards
Things I need to look up in my daily work
In vue 2, if you’re attempting to style a nested component within a child component, what do you need to use?
In Vue 2 with scoped styles, you must use the ::v-deep selector to target nested elements within child components
<style>
\::v-deep(.custom-time-picker .v-time-picker-title\_\_time .v-picker\_\_title\_\_btn), \::v-deep(.custom-time-picker .v-time-picker-title\_\_time span) { font-size: 25px !important; height: 25px !important; }</style>
How do you destructure an object with one key value pair?
const [[key, value]] = Object.entries(obj);
Object.entries(obj) converts the object into an array of [key, value] pairs.
Example: { key: ‘value’ } becomes [[‘key’, ‘value’]].
The destructuring [[key, value]] extracts the first [key, value] pair from the array.
How do you check if a string contains a substring?
text.includes(“string”)
In javascript, what kind of argument does .findIndex() expect?
A function. For example:
return COLORS.findIndex(c => c === color);