Vector spaces "over" a topological space The definition of a vector bundle includes a map $\pi : E \rightarrow X$ and an assignment to each $x \in X$ a vector space structure on $\pi^{-1}(x)$. However, I find this viewpoint a little strange and hard to work with. So, I was just wondering if we can recast this in slightly different terms.
Given a commutative ring object $R$ in the category $\mathbf{Top}$, it seems to me that we can get a corresponding commutative ring object $R$ in the slice category $\mathbf{Top}/X$, namely $(X \times R, (x,r) \mapsto x).$ My idea was then to study $R$-module objects in the category $\mathbf{Top}/X$, and with a bit of luck, these will turn out to be the same as maps $E \rightarrow X$ that are equipped with $R$-module structures on each fiber.

Question. Does this work, and if not, what goes wrong?
Also, is there a slick way of expressing the local triviality condition in this framework, so as to recover the usual definition of a vector bundle?

 A: Yes, and this is probably the best framework for a conceptual definition of vector bundles, because you can prove many basic results about vector bundles just by proving them for $R$-modules in a general categorical setting (i.e. if $R$ is a ring object in a cartesian category). Unfortunately you cannot find it in most introductory texts.
Notice that an $R_X := (X \times R \to X)$-module object in $\mathbf{Top}/X$ is not just a map $E \to X$ with topological $R$-module structures on the fibers, but they should "vary continuously over $X$". To be precise, one requires that scalar multiplication $R \times E  = R_X \times_X E \to E$ and addition $E \times_X E \to E$ are continuous.
The category of $R_X$-modules is additive. Finite coproducts and products coincide, and are given by fiber products over $X$. Notice that $R_X$ can be regarded as an $R_X$-module. Hence, also $R_X^n = R^n \times X$ can be regarded as an $R_X$-module. Let us call an $R_X$-module finite free if it is isomorphic to $R_X^n$ for some $n$.
It is clear that every map $X \to Y$ induces a pullback functor from $R_Y$-modules to $R_X$-modules. If $X \to Y$ is the inclusion of a subspace, then this will be simply called restriction.
Definition. An $R$-module bundle over $X$ is an $R_X$-module $E$ for which there exists an open covering $\{X_i \to X\}$ such that $E|_{X_i}$ is finite free. If $R$ is a field, we speak of $R$-vector bundles as usual.
Notice that the same defintion works verbatim for a) the category of manifolds, and b) the category of schemes (usually with $R=\mathbb{A}^1$). For schemes the "fiberwise" definition does not work anyway.
