Vue bind directive

The term vue bind may refer to one of the many ways to bind some text to an element in a vue js template. However when it comes to the idea of binding text to an element in a vue template there is more than one thing that comes to mind about that. For example there are text nodes of elements, there are attribute names and values for elements, and then there is raw html itself all of which can be thought of as a kind of text. So then there are a few ways to go about binding something to a template in vue js depending on what it is that needs to be bound to a template, and where, so it is a good idea to get these things worked out when it comes to working with text and templates in a vuejs project.

There are ways to go about binding some kind of value to the text node of an element, for that there is the mustache syntax, and also the text directive. There is also not just text nodes, but also parsing an html string into actually html and appending that to a template, which can also be done with the mustache syntax. However on top of all of that, what if I want to use some text not as the value of a text node, but as a value for an attribute of an element in a vuejs template? For these kinds of tasks there is the vue bind directive that can be used in a number of ways to bind some text in a vue data object, or as the result of a simple javaScript expression, as the value for one or more elements in a vue example.

This might all be a little complicated, but just a few quick examples are enough to iron things out with this. So lets take a look at a few simple examples of binding text to elements, using various ways of doing so including the text, and bind directives.

Read More

The lodash \_.method method as well as other methods of interest

The lodash _.method method can be used to call a method at a given path when used with another lodash method like _.map, or _.filter just to name a few such options. In other words say you have this function as a property of an object that is one of many such objects in a collection of sorts, and you want to use this function with a method like map to create a custom form of the collection. If you are in this kind of situation then this is a situation in which you might consider using the lodash _.method method.

There is also however maybe more that one intension of what the term “lodash method” means. Maybe you are looking into some content that has to do with the main lodash method of the lodash global that is used in the process of chaining for example. There is also lookinto into the subject of “lodash methods” in terms of what there is to work with when it comes to the full API of what there is to work with in the javaScript utility library known as lodash.

This is one of the lesser known methods in lodash that I do not see myself using often, and if you are scratching your head wondering if this is a feature that makes lodash worth the hassle or not this might be one of those kinds of lodash methods. It would seem that are are a lot of developers these days that think that lodash is an outdated utility library, some of them even go so far as to say that using lodash never even made sense to begin with. Maybe they are half write, but in any case in this post I am going to be looking into this lodash method, and also maybe look into some ways to do the same thing with vanilla javaScript t see if this is really a useful method, or yet even more unneeded bulk in lodash.

Read More

The vue name option in component design

The vue name option is something that comes into play when getting into vue component design. Depending on how I go about adding a component into vuejs the vue name might not need to be specified in the object that defines the nature of the component, at least that is the case with global components added by way of the Vue.component method. However when making local components it might be a good idea to set the name in the object, doing so is still optional, but I might run into some problems when neglecting adding it to an object.

Read More

Git log examples and nodejs scripts

The git log command can be used to log out a list of comment subject messages, commit hash numbers, and A wide range of other things about each commit in a git folder. It is a useful little command with many format options that can be useful when it comes to writing some kind of script that loops over all commits in a repository. There is just using the command by itself in the command line, and then there is piping it to something else, or better yet making a node.js script that uses it via the spawn method in the child process module. In this post I will be going over some quick examples of doing bolth.

Read More

vue parent option example

In vuejs there are times when I am going to need some kind of parent child relationship with two or more vue instances, one option for this is the vue parent option. This option will result in a reference to a parent vue instance within the child vue instance in which the vue parent option is used, and will also result in the child vue instance being added to the children property of the parent vue instance.

Another way to go about breaking things down would be to go about getting into making components, however going that way with things can get a little involved when it comes to mutating data. When I make components I have to pass data to it with the props option, and then make use of events as a way to pass mutated data back to the parent vue instance that makes use of the component. So maybe the use of the parent option is a better choice in some cases, depending on what I want to do.

Read More